I am trying to build a strategy that would buy if the W%R indicator goes from under to above -80 on a 5min bar.
But it must buy only if the ask price is above the last bar high. But it didn't work, it still buy at the open of the new bar and not at the high of last bar

here is the code:
protected override void OnBarUpdate()
{
// Condition set 1
if (WilliamsR(14)[0] > -80
&& WilliamsR(14)[1] < -80
&& GetCurrentAsk() > High[1])

{
EnterLong(1000, "");
Thank you in advance.

Comment