[請益]關於程式交易
本帖最後由 lc754032 於 18-3-31 13:31 編輯最近使用永豐eleader他們的程式交易我想設定8:45的開盤點 但是卻變這副德性 = =
http://www.coco-in.net/forum.php?mod=image&aid=112730&size=300x300&key=fbfb20df4ceca80d&nocache=yes&type=fixnone
後來只好用成手動輸入價位 ><"
但還是想知道開盤點到底要設哪個參數... 想去回測過去的績效
還有第二個問題是
如果出單有2個機制
"如果A條件不符合的話,就收盤出單"該怎麼寫這個的語法呢.....
我試過好幾次 有試過OR根AND 都不是我要呈現出來的訊號><"
也爬了好幾篇文章 但還是沒能成功 ><"
http://www.coco-in.net/forum.php?mod=image&aid=112731&size=300x300&key=a0f0ca6b6218a4a2&nocache=yes&type=fixnone
我這樣子寫收盤時間擺在上面 結果收盤的訊號硬生生不見=口=
哀 還請各位大大們幫幫我指點迷津><"""
eleader 是用 PYTHON 寫的
所以建議直接使用 PYTHON 來寫程式交易會更好 Simon 發表於 18-4-1 20:52
eleader 是用 PYTHON 寫的
所以建議直接使用 PYTHON 來寫程式交易會更好
Simon 大大 我們開盤的第1跟k棒 如果要用pyhton的語法寫的話是該設哪個函數啊 本帖最後由 Simon 於 18-4-2 19:08 編輯
因為 Python 我也不會, 只能找到一篇 E LEADER 的PYTHON 語法給你參考囉。
1. e-leader language is base on Python
so you can use python grammer and function
2. there are some functions belows
array : make new array - x = accum(array(len(c), 1))
iff :accumulate values - accum(iff(c>c, 1, 0), 15) * 100 /15
max : max value betwwen 2 data - max(c, h)
max3 : max value betwwen 3 data -max3(h - l, c - h, c - l)
min : min value
min3: min value
lowest: lowest value in specific period - lowest(l, 10)
llv : llv(v, 10)
highest : highest value in specific period- highest(h, 20)
hhv : hhv(c,10)
sqrt : sqrt(100) or sqrt(c)
pow : pow(c,2)
log : log(c/c),period)
log10
sin
cos
tan
atan
floor : floor(c,2)
ma
ema
wma
accum: accum((((c-l)-(h-c))/(h-l))*v) or accum(array(len(c), 1))
cum
std : std(c, 10)
corr : corr(c,h,10)
ref :
barsince : barsince(c>h)
highestbars
lowestbars
hhvbars: hhvbars(h, 15)
llvbars: llvbars(l, 15)
mid : mid(c,10)
cross
crossover
crossunder
trend
reverse
some samples
1. binary wave
#buy condition :
maperiod = 20
rocperiod = 14
stoperiod1 = 5
stoperiod2 = 4
cond1 = iff (ma(c,12)-ma(c,26) > ma(ma(c,12)-ma(c,26),9), 1,-1)
cond2 =iff (c > ma(c, maperiod), 1, -1)
cond3 = iff ((c - c) / c * 100 > 0, 1, -1)
cond4 =iff (ema((c-lowest(l, stoperiod1)) / (highest(h, stoperiod1) - lowest(l, stoperiod1)) * 100, stoperiod2)>50, 1, -1)
(cond1 + cond2 + cond3 + cond4 > 0)
#sell condition
maperiod = 20
rocperiod = 14
stoperiod1 = 5
stoperiod2 = 4
cond1 = iff (ma(c,12)-ma(c,26) > ma(ma(c,12)-ma(c,26),9), 1,-1)
cond2 =iff (c > ma(c, maperiod), 1, -1)
cond3 = iff ((c - c) / c * 100 > 0, 1, -1)
cond4 =iff (ema((c-lowest(l, stoperiod1)) / (highest(h, stoperiod1) - lowest(l, stoperiod1)) * 100, stoperiod2)>50, 1, -1)
(cond1 + cond2 + cond3 + cond4 < 0)
sample 2 - standard error band (top band calculation)
period = 10
x = accum(array(len(c), 1))
sx = accum(x, period)
sy = accum(c, period)
sxy = accum(x * c, period)
sx2 = accum(pow(x,2), period)
sy2 = accum(pow(c,2), period)
bdata = ((period * sxy - sx * sy) / (period * sx2 - pow(sx,2)))
adata = ((sy - bdata * sx) / period)
stde = sqrt(abs((1.0 / (period * (period - 2))) * ((period * sy2 - pow(sy,2)) -(pow((period * sxy - sx * sy), 2)) / (period * sx2 - pow(sx,2)))))
stderrvalue = adata + (bdata * x) + (2 * stde) 感謝SIMON大大的分享~~ 我研究看看ㄎㄎㄎ
感謝SIMON大大的分享 感謝各位大大的知識分享. {:4_160:}
頁:
[1]