if( entry_dir )
ExitLongLimit( entry_target );
else
ExitShortLimit( entry_target );
At the line "ExitLongLimit( entry_target );" I get a crash:
System.IndexOutOfRangeException was unhandled by user code
Message=Index was outside the bounds of the array.
Source=NinjaTrader.Core
StackTrace:
at NinjaTrader.Strategy.StrategyBase.PlaceOrder(Int32 selectedBarsInProgress, Boolean liveUntilCancelled, OrderAction action, OrderType orderType, Int32 quantity, Double limitPrice, Double stopPrice, String signalName, String fromEntrySignal, String oco, Boolean simStop)
at NinjaTrader.Strategy.StrategyBase.ExitLongLimit(Do uble limitPrice)
at NinjaTrader.Strategy.TradeRetrace.OnBarUpdate() in c:\Users\daniel\Documents\NinjaTrader 7\bin\Custom\Strategy\TradeRetrace.cs:line 391
at NinjaTrader.Strategy.StrategyBase.Process(Object sender, BarUpdateEventArgs e)
InnerException:
What happens if I no longer have a long position, will NT handle this call properly or fail? I know this is not the problem because I already checked for having a position, but it is still important to know. The Position.MarketPosition is Long with a quantity of 2.
Comment