PDA

View Full Version : What bar does order execute?


Folls
05-15-2007, 01:15 PM
I have a strategy with two symbols. Each uses a 1m timeframe. So, each bar prints at the same time. On which bar should I see the order executed? It appears the order is getting placed two bars after the diamond is drawn. Shouldn't it be placed one bar after? Isn't the order like saying, "place order next bar at market?"

Code summary. The actual code is much longer.

if (BarsInProgress == 0)
{
placeLong = true;
DrawDiamond(....);
}

if (BarsInProgress == 1 && placeLong)
{
EnterLong();
}

Thanks,

Folls

NinjaTrader_Ray
05-15-2007, 01:22 PM
During backtest, the order will be filled (if fillable) on the bar after the Enter() method is called. To verify, add a Print(Time[0]) statement when you call EnterLong().

In real-time, the order is submitted when the method is called and it will be plotted when it is actually filled based on the time stamp of the execution.