Coding Problem: Open[1] gt EMA12
I'm having some trouble in programing a line. I'm looking to have among the opening requirements be the 12 EMA be not greater than the open of the bar. I'm doing transactions to try and not open at a sideways market.
This is the code line:
if((Close[2] gt;= Close[1]) (Open[1] gt;= Open[0]) (Open[1] gt; ema12) (ema12 gt; ema24))upcandle = true;
The ema12gt;ema24 code works just fine, but the Open[1] gt; ema12 does not do the job. In back testing there are occasions where there is a trade opened below the ema12.
Suggestions???
Thanks!