I am trying to compare two bars.
I have the following code:
if(Close[0] > EMA(5)[0]) { double val1 = High[0]}.
So I have the following code:
if(Close[0] > EMA(5)[0]) { double val1 = High[0] if(Close[0] > val1) {DrawArrow();}}.
To summarize:
1) A bar has to cross above the EMA. This bar should be the bar of interest. Its value is saved.
2) The first next bar closing above the bar of interest will be the signal bar. My problem is when the signal bar is not the bar closing directly after the bar of interest, but later.
How to locate this signal bar? I would appreciate any help.
Many thanks in advance.
Comment