Bonjour,
Quelle est la formule littérale de l’instruction “Exponentialaverage ” utilisée dans prorealtime ?
Merci
SMA = average[10] = (close)
SMA = average[10,0](close)
Ema = average[10,1](close)
https://www.prorealcode.com/documentation/average/
defparam drawonlastbaronly = true
if barindex > 30 then
// average!
EMA1 = average[20,1](close)
//ExponentialAverage!
EMA2 = ExponentialAverage[20](close)
// calculated ema
n = 20 // lookback
k = 2 / (n + 1 ) // constant
ema = close[0] * k + ema[1] * ( 1 - k ) // 'close'
drawtext( "EMA1: #EMA1#",0,0)anchor(middle,xshift,yshift)coloured("yellow")
drawtext( "EMA2: #EMA2#",0,-20)anchor(middle,xshift,yshift)coloured("red")
drawtext( "ema : #EMA#",0,-40)anchor(middle,xshift,yshift)coloured ("Green")
endif
return /*
*/ EMA1 coloured("yellow")style(line,5) /*
*/ , EMA2 coloured("red") style(dottedline,3) /*
*/ , ema coloured ("Green") style(line,3)
/**/