cherryjo 發表於 11-10-14 10:22

e-leader functions

1. e-leader language is base on Python (www.python.org)
   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)

samchen80 發表於 11-10-14 11:14

給你一個讚!可是我的eleader不能用囉!還是謝謝{:4_113:}

f29825604 發表於 16-7-23 10:32

感激不盡!
學習ing
{:8_546:}

hategod 發表於 17-6-5 22:42

了解,原來iff還可以這樣用,自設參數的用法也是看完才知道,謝謝

miyusuea 發表於 17-7-11 23:08

cool 原來可以這樣用,自設參數的用法也是看完才知道,謝謝~

sdanley24 發表於 18-7-28 17:40

請問 每天的第一根 k棒正負20點下單要怎麼設定

gegataco 發表於 18-8-16 07:19

新手學習程式語言中謝謝
頁: [1]
查看完整版本: e-leader functions