Hi all I am trying to get a indi of mine to use the alert price minus the open price of the candle 2 candles later, if that makes sense.
It basically sums up some stats for me then.
I have everything working fine except for it to wait for 2 candles to run the calculations.
I removed all my attempts at getting it to work and have the code posted below, any help would be loved!!!
static datetime dtlboai11;
static int NewSignal,Win,Loss;
static double SignalPrice;
// calculate profit
Doing it backwards will be easier. You can use Open rather than the static variable SignalPrice. The code is also missing a closing bracket, so I am assuming that you are setting the new value for dtlboai11 (and SignalPrice) at each new bar. If not, then the condition will not execute, as dtlboai11 will always be zero.