08/25/2010 2:39:22 PM Entered internal PlaceOrder() method at 08/25/2010 2:39:22 PM: Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='ShortatVPC' FromEntrySignal='' Short InPostion = False Execution='NT-00004' Instrument='ES 09-10' Account='Backtest' Name='ShortatVPC' Exchange=Default Price=1052.25 Quantity=1 Market position=Short Commission=2.2 Order='NT-00006' Time='08/25/2010 2:40:00 PM'
timeframe 0 = range bars = 2 ticks
timeframe 1 = 5 min bars
All this happens in BarsInProgress == 0 with traceorders = true
private IOrder entryOrder = null;
if (!InPosition)
{
entryOrder = EnterShort(0, 1, "ShortatVPC");
Print("Short");
Print("InPostion = " + InPosition);
}
privatebool InPosition { get { return Position.MarketPosition != MarketPosition.Flat; } }
protectedoverridevoid OnExecution(IExecution execution)
{
if (entryOrder != null && entryOrder == execution.Order)
Print(execution.ToString());
}
Notice the timestamps on the messages.
So what am I missing...why does it take 38 sec? and why doesn't OnExecution fire before InPosition evaluates? And why does InPosition evaluate to false anyways? I am stumped.

Comment