The SubmitOrderUnmanaged method has a very long signature (which is quite poor from an API point of view tbh) and it took me a while to figure out that I had got two of the parameters mixed up and was trying to submit an order for Zero currency. The parameters should be validated and give meaningful error messages if they are not correct rather than causing an unhandled exception further up the stack in the TimeSeries class.
2000 Intermediate Timeframe Bars have been received. Dispatching to Intermediate Pipeline for processing
Finished processing Intermediate Timeframe bars
2000 Higher Timeframe Bars have been received. Dispatching to Higher Pipeline for processing
Finished processing Higher Timeframe bars
Submitting Long Trade: OrderDetails: Long Quantity:4589 Entry:1.58846 Stop:1.58752 Target:1.59025
Submitting Order:
OrderDetails: Long Quantity:4589 Entry:1.58846 Stop:1.58752 Target:1.59025
02/10/2015 11:11:58 Strategy 'TruffleHogForex5000/55154578': Entered internal SubmitOrderUnmanaged() method at 02/10/2015 11:11:58: BarsInProgress=0 Action=Buy OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='longentry'
State has transitioned to termination state
Disabling NinjaScript strategy 'TruffleHogForex5000/55154578'
System.NullReferenceException: Object reference not set to an instance of an object.
at NinjaTrader.NinjaScript.TimeSeries.get_Count()
at NinjaTrader.NinjaScript.TimeSeries.get_Item(Int32 barsAgo)
at NinjaTrader.NinjaScript.StrategyBase.SubmitOrderUn managed(Int32 selectedBarsInProgress, OrderAction orderAction, OrderType orderType, Int32 quantity, Double limitPrice, Double stopPrice, String oco, String signalName)
at NinjaTrader.Custom.MyProjects.TruffleHog.Trading.T radeInitiator.SubmitOrder(OrderDetails details) in c:\Users\kevin\Documents\NinjaTrader 8\bin\Custom\Strategies\__temp_Trading_TradeInitia tor.cs:line 90
at NinjaTrader.Custom.MyProjects.TruffleHog.Trading.T radeInitiator.InitiateLTFTrade() in c:\Users\kevin\Documents\NinjaTrader 8\bin\Custom\Strategies\__temp_Trading_TradeInitia tor.cs:line 60
at NinjaTrader.NinjaScript.Strategies.TruffleHogForex 5000.OnBarUpdate() in c:\Users\kevin\Documents\NinjaTrader 8\bin\Custom\Strategies\__temp_TruffleHog_TruffleH ogForex5000.cs:line 299
The Current Thread ID is 28
FXCMRatesProxy grabbing Rates
Comment