Hello,
It s probably super simple but i can’t make it so ..
Do you know how i could test if the accumulation distribution line is above or below an Exponential moving average ?
Thanks
myAD = AccumDistr(open)
EMA150 = exponentialaverage[150][myAD]
if myAD > EMA150 then
drawvline(barindex) coloured(0,255,0)
else
drawvline(barindex) coloured(255,0,0)
endif
return
You might need to ensure that you have enough bars to do the first average calculation. Often this is an issue why indicators do not display. Not tested – just a guess.
if barindex >= 150 then
myAD = AccumDistr(open)
EMA150 = exponentialaverage[150][myAD]
if myAD > EMA150 then
drawvline(barindex) coloured(0,255,0)
else
drawvline(barindex) coloured(255,0,0)
endif
endif
return
Thanks for the Reply,
Unfortunately i run in the same error :
“Error in the indicator ”
“A positive integer field is expected with myAD”
You used brackets for the data serie in your EMA instruction while it needs parenthesis:
EMA150 = exponentialaverage[150](myAD)
“A positive integer field is expected with myAD”
That key bit of information might have been quite useful in your first post!