I am trying to code the following condition:
Check if the Close has crossed above & closed above the EMA(10) in the past 20 bars
Which means, that a previous bar's close is less than the EMA and the current bar's close is above the EMA. So in essence, the CLOSE has crossed above the EMA and CLOSED above it,
I am coding it as follows:
if(CrossAbove(Closes[1], EMA(BarsArray[1], 10), 20))
{
//Do work
}
Am i misunderstanding the function's meaning? If so what's the correct interpretation and how can i implement the condition i need?
Please advise.
Thanks
Umer


Comment