I have a strategy where an entry condition occurs and if a secondary condition occurs within 3 bars of the first condition then the trade should be entered.
On the first condition I set a variable, triggerBar, equal to CurrentBar. To check it's OK to enter on the second condition I have:
if (CurrentBar - triggerBar < 4)
then do something...
This works fine on historical data but I had an instance on Friday whilst live trading where the trade was entered even though my triggerBar occurred 5 bars ago.
So my question is, does CurrentBar refer to the currently forming bar or the last completed bar? I notice from NT Help that CurrentBar value is guaranteed to be <= Count - 1.
The strategy was running on a one minute timeframe.

Comment