For some reason my IOrder variable is not seen as NULL initially.
I set it to NULL, but its not seen as NULL when it gets to OnBarUpdate() section.
In the output window, its seen as containing the following text:
longOrderA = Order='NT-00003/Sim101' Name='Long Part A' State=Cancelled Instrument='TF 06-11' Action=Buy Limit price=855.3 Stop price=0 Quantity=1 Strategy='rcsSimpleSuperGrail' Type=Limit Tif=Day Oco='' Filled=0 Fill price=0 Token='160642e28e2a49b0b15e28fd9472fd63' Gtd='12/1/2099 12:00:00 AM'
Not sure what I'm doing wrong. I have my code listed below.
Variable:
Private IOrder longOrderA = null;
OnBarUpdate()
if ( longOrderA == null && arrowDir == "up" ) // && "other code for those two indicator arrows" )
{
if ( Position.MarketPosition == MarketPosition.Short ) // handling Stop and Reverse condition
{
ExitShort();
SetStopLoss(CalculationMode.Ticks, _initialStopLoss);
}
longOrderA = EnterLongLimit(_numOfContracts, GetCurrentBid(), "Long Part A");
barNumberOfOrder = CurrentBar;
}

Comment