[COLOR=#add8e6]if[/COLOR] ([COLOR=#f0f0f0]jelDirection[/COLOR] == -[COLOR=#22cdff]1[/COLOR])
{
[COLOR=#f0f0f0]Print[/COLOR]([COLOR=#0076ec]"Enter Place Short"[/COLOR]);
[COLOR=#f0f0f0]Print[/COLOR]([COLOR=#0076ec]"Ask: "[/COLOR] + [COLOR=#f0f0f0]GetCurrentAsk[/COLOR]());
[COLOR=#f0f0f0]Print[/COLOR]([COLOR=#0076ec]"QTY: "[/COLOR] + [COLOR=#f0f0f0]_TradeQTY[/COLOR]);
[COLOR=#f0f0f0]EnterShortLimit[/COLOR]([COLOR=#f0f0f0]_TradeQTY[/COLOR], [COLOR=#f0f0f0]GetCurrentAsk[/COLOR](), [COLOR=#0076ec]"jelOrder"[/COLOR]);
[COLOR=#f0f0f0]Print[/COLOR]([COLOR=#0076ec]"OrderPlaced"[/COLOR]);
[COLOR=#f0f0f0]barNumberofOrder[/COLOR] = [COLOR=#f0f0f0]CurrentBar[/COLOR];
[COLOR=#f0f0f0]Print[/COLOR]([COLOR=#0076ec]"*** ENTER SHORT*** Bar#"[/COLOR] + [COLOR=#f0f0f0]barNumberofOrder[/COLOR] + [COLOR=#0076ec]" jelDir: "[/COLOR] + [COLOR=#f0f0f0]jelDirection[/COLOR] + [COLOR=#0076ec]" dirSC: "[/COLOR] + [COLOR=#f0f0f0]dirSC[/COLOR][[COLOR=#22cdff]0[/COLOR]] + [COLOR=#0076ec]" scDirCount: "[/COLOR] + [COLOR=#f0f0f0]_scDirectionCount[/COLOR] + [COLOR=#0076ec]" dirTH: "[/COLOR] + [COLOR=#f0f0f0]dirTH[/COLOR][[COLOR=#22cdff]0[/COLOR]] + [COLOR=#0076ec]" dirIndex: "[/COLOR] + [COLOR=#f0f0f0]dirIndex[/COLOR][[COLOR=#22cdff]0[/COLOR]]);
}
Enter Place Short Ask: 2087.25 QTY: 1 Strategy 'jelMM2/-1': Error on calling 'OnOrderUpdate' method on bar 158: Object reference not set to an instance of an object. OrderPlaced
The execution never makes it out of the function before the error because the very next step is to exit this function and enter a function called form OnBarUpdate to manage the trade. It never makes it to that print statement.
Is there a way to do a line-by-line step through the code? using print statements is making it hard for me to debug.

Comment