I hereby claim:
- I am fatfingererr on github.
- I am fatfingererr (https://keybase.io/fatfingererr) on keybase.
- I have a public key whose fingerprint is 5F03 3B55 1EF4 D27A 36D5 AA39 F013 CD96 337A 1E28
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
%% Math %% | |
si = @(x) sin(x)./x; % cardinal sine without pi multiplied argument | |
hsin = @(x) 0.5*(1.0 - cos(x)); % haversed sine | |
hcos = @(x) 0.5*(1.0 + cos(x)); % haversed cosine | |
sigm = @(x,k) 0.5*tanh(0.5*k*x) + 0.5; % sigmoid function to (exp(-kx)+1)^-1 |
; Packed shepherd together with mincemeat for convenience | |
(import [mincemeat.shepherd [run_server]]) | |
; chunker is temporarily broken | |
;(defn chunker [gen size] | |
; (let [[gen (iter gen)] | |
; [chunk []] | |
; (try | |
; (while True | |
; (for [_ (xrange size)] |
(defun build-variable () | |
(interactive) | |
(let | |
;; 擷取當前那行程式碼並依照空格分開來 | |
((line-string (split-string (thing-at-point 'line t)))) | |
;; 刪除原本那行 | |
(kill-whole-line) | |
;; 新的一行會從原本那行第一個元素和剩下元素但首字大寫做合併 | |
(setq new-line-string (apply 'concat (append (list (first line-string)) (mapcar 'capitalize (cdr line-string))))) | |
;; 插入新的那行 |
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from ib.ext.Contract import Contract | |
from ib.opt import ibConnection, message | |
from time import sleep, strftime | |
import pandas as pd | |
import numpy as np | |
################# 請記得開啟 TWS 並將 API port 設定為 7496 #################### |
% 寫一個函數來得到 MTF | |
% 輸入 : | |
% - all_ts < 1 x N double > 時間序列資料 | |
% - window_size < int > 資料窗格大小(類似技術指標的參數) | |
% - rolling_length < int > 每次滾動移動大小 | |
% - 可以抓 window_size 的 1/8 ~ 1/10 做觀察, 若和 window_size 一樣,資料就不會重疊 | |
% - quantile_size < int > 分位數,就是可以快速地做 K 分位數 (當 quantile_size = 4 就會有四分位數 ) | |
function markov_field = mtfDemoFunction( all_ts, window_size, rolling_length, quantile_size ) | |
% 清理畫面和關閉顯示的圖 |
-----BEGIN PGP MESSAGE----- | |
Version: Keybase OpenPGP v2.0.73 | |
Comment: https://keybase.io/crypto | |
wcFMA+ICheZXm1RGAQ/+JSwo+Jh7kHUxOi+NQ1xYRzYOtZor4nqt9WHcpM3yqnYJ | |
Uzk+RMmRLw0VuPHdJ+gkNz6ZvBFmFojri3wh1Y4jx6xatnv4vFEU8iV6mRhQRPb3 | |
8EQqJatt5P/6aoxQSfKpKi8lG11iAUz5VA09S+qDNKYOh7ygvI3dBSYlqenFnoOC | |
yDxtC+bPIS12ukfu0xZRBT3CsilfJCslEJug6i2cz4QsaPTBSYmKSTc4pIE5Oh7p | |
+UUHs06CK5+ina471eNXKirKO1eNeD3epcC1Dl2GQMpkgXcBYEOaq/H9hFp5ZtlC | |
4PHkrCgVXdNY/7JX3p2BEJXXxKmvdr+uefUfacygPvlBvjDk7Q1bINEsUDiZrbe8 |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Comment: https://keybase.io/download | |
Version: Keybase Go 1.0.17 (windows) | |
xsFNBFgSKBUBEADEW4mgUeR88EVfurQKVj3UP4RlO+FGwPRSqHipdZm8r0pX7k9E | |
w0+L+ZPBjzWWBrI9p7hm4I+h8f2N3XMcuhyzhpYcr+VP0HLW/MNMsNa8h4s+78LN | |
1qLORZBsE0ZinGoL/iwFZOv6gxAnoSQ+AzA+NwzfGsstt65xllcJZpof8WuJdPUX | |
sIxN2qp+wEKr/dDpE1Jj435K34tp3NF+WhuCu3Y6+xK7OX6iMsCcXjiPZJDoz0J4 | |
lEoDeaAmHuri1Sjwe00R99YaoYET4WO8SDw2i7X07x/AY4NdZ3Vm2FOJrlbiDIVa | |
KDjbXhveXRx2HctAv8lFnUIsn7Pas91l6U+vVmEMBg7baza96tR+qpbPNap6koDe |
clc | |
clear all | |
disp('get GBPUSD M5 data...'); | |
getPrice ; % get P | |
disp('done!'); | |
train_ratio = 0.7 ; | |
nIter = 100; | |
epsilon = 10^(-10); | |
cci_period = 14 ; |
// 完整来源 (Metatrader, MQL, 类似 C++): | |
// https://www.earnforex.com/metatrader-indicators/volume-profile/ | |
void VolumeProfileCalculate(){ | |
// 根据参数设置找到起始bar数 | |
int BarStart=iBarShift(Symbol(),VPTimeFrame,StartTime); | |
// 如果要整跟 KLINE 都做统计 (=Whole), 还是一根 KLINE 只统计 Close 或 Open | |
int PriceHighMode=MODE_CLOSE; |