I am trying to code the following strategy:
If conditions are met on three consecutive bars I want to enter trade on next bar. I have attempted to code this but I will be extremely grateful for any code examples because I am struggling with this one!
private int good1
private int good2
private int good3
if(condition1)
good1 = CurrentBar; // if conditions are met go to next bar
if
(CurrentBar = good1 + 1) // if conditions are met go to next bar
&& (condition2)
CurrentBar = good2;
if
(CurrentBar = good2 + 1) // if condtions are met go to next bar
&& (condition3)
CurrentBar = good3;
EnterShort([0] + 1) //Enter short on next bar
Comment