if (ioLEntryOrder != null && ioLEntryOrder.Token == execution.Order.Token)
ioLStopLoss = ExitLongStop(0, true, 100, ioLEntryOrder.AvgFillPrice - 2 * dEntryATR, "StopLoss", "LongEntry");
if (ioLEntryOrder != null && ioLEntryOrder.Token == execution.Order.Token)
ioLEntryOrder2 = EnterLongStop(0, true, 100, ioLEntryOrder.AvgFillPrice + .5 * dEntryATR, "Entry2");
but this code
if (ioLEntryOrder != null && ioLEntryOrder.Token == execution.Order.Token)
{
ioLStopLoss = ExitLongStop(0, true, 100, ioLEntryOrder.AvgFillPrice - 2 * dEntryATR, "StopLoss", "LongEntry");
ioLEntryOrder2 = EnterLongStop(0, true, 100, ioLEntryOrder.AvgFillPrice + .5 * dEntryATR, "Entry2");
}
generates "Error in calling the 'OnExecution' method for strategy "strat1": Object reference not set to an instance of an object. aren't these pieces of code really the same thing?
Regards,
Ben
Comment