本帖最後由 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], 1, 0), 15) * 100 /15
max : max value betwwen 2 data - max(c[1], h)
max3 : max value betwwen 3 data -max3(h[1] - l[1], c - h[1], c - l[1])
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[1]),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[rocperiod]) / c[rocperiod] * 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[rocperiod]) / c[rocperiod] * 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) |