PDA

View Full Version : Cbi.MarketData.StartNow exception


trader20
09-28-2009, 09:09 AM
I have a simple strategy that enters on a limit and uses the SetProfitTarget and SetStopLoss functions. When running on the Sim101 account, the stragety works as expected. However, today I ran the strategy on a live account and although the entry order was sumitted and filled as expected, the stop loss and profit target orders were not submitted. In the log file immediately following the entry fill, there was the following message:

9/28/2009 7:55:26 AM|3|4|Cbi.MarketData.StartNow: exception caught: Item has already been added. Key in dictionary: 'ESZ9' Key being added: 'ESZ9'

Please does this exception mean? I am sure this is a clue as to why the stop loss and profit target orders were not sumbitted.

NinjaTrader_Josh
09-28-2009, 09:23 AM
trader20,

Which brokerage technology are you using?

trader20
09-28-2009, 09:32 AM
ZenFire at Mirus

NinjaTrader_Josh
09-28-2009, 09:49 AM
trader20,

Please attach your complete trace and log files with the time you placed the order. Thank you.

trader20
09-28-2009, 10:14 AM
Here's the log file. (The brokerage account number is 'x' out for privacy). I didn't have TraceOrders set at the time this happened.

NinjaTrader_Josh
09-28-2009, 10:20 AM
You should still have trace logs that include information in My Documents\NinjaTrader 6.5\traces. Thank you.

trader20
09-28-2009, 11:59 AM
OK, here it is. The problem is at 7:55:26 when the entry order was filled. There should have been a stop and target order entered. I see an additional exception at 7:55:26:270 when the stop loss and profit target should have been entered.

You can see an example of the same strategy working in the Sim101 account on ZN at 7:44:45:051. After the entry fill, you can see the stop and target get submitted as expected.

NinjaTrader_Josh
09-28-2009, 01:50 PM
Will get back to you after the investigation. Thank you for your patience on this matter.

trader20
09-28-2009, 02:20 PM
Ok. Thanks.

trader20
09-28-2009, 05:16 PM
I found something. In the trace log at 7:55:26:207 you can see the fill for instrument 'ES 12-09'. However, at 7:55:26:254 and thereafter, you can see references to instrument 'ES_DT 12-09'. ES_DT is a continuous contract that I created with the same parameters as the real 'ES'. Somehow, NT is getting confused between the two. I don't know why that would be happening, I certainly don't reference it in my strategy and there was no chart of ES_DT open.

I have deleted ES_DT in the instrument manager and I suspect that will fix the problem. However, I would like to recreate ES_DT for backtesting purposes. Maybe the problem was that when I created ES_DT, I set the Zen-Fire symbol map to 'ES', which is the same as the real ES instrument, so maybe that was confusing NT.

I will try running the strategy live tomorrow after having deleted ED_DT and report the result.

NinjaTrader_Josh
09-29-2009, 07:13 AM
That was the same conclusion development reached. Good luck.