Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug back? Data.MarketData.StartNow: exception

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Bug back? Data.MarketData.StartNow: exception

    I am on NT7B15 with ZenFire and ran into what I believe to be a bug:
    Data.MarketData.StartNow: exception caught: Item has already been added. Key in dictionary: 'NGM0' Key being added: 'NGM0'
    and respectively:
    Data.MarketData.StartNow: exception caught: Item has already been added. Key in dictionary: 'NGN0' Key being added: 'NGN0'

    exactly as described here:


    On trying to reproduce I could reproduce this using either
    a chart
    or a live Strategy on the sim101
    with either
    NG06-10 or NG07-10 (both Nymex)

    Restarting did not help neither did removing the instruments and adding them again.

    #2
    Hello purdey,

    Thank you for your post and welcome to the NinjaTrader support forum!

    Please provide me with the specific steps that I will need to take to cause this to occur on my end.
    KyleNinjaTrader Customer Service

    Comment


      #3
      1st start this Strategy (ZenFire) on Sim101 NG06-10 1Tick data
      Code:
      #region Using declarations
      using System;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Drawing;
      using System.Drawing.Drawing2D;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Data;
      using NinjaTrader.Indicator;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Strategy;
      #endregion
      
      // This namespace holds all strategies and is required. Do not change it.
      namespace NinjaTrader.Strategy
      {
          /// <summary>
          /// Enter the description of your strategy here
          /// </summary>
          [Description("Enter the description of your strategy here")]
          public class Gastest : Strategy
          {
              #region Variables
              // Wizard generated variables
              private int myInput0 = 1;
              private bool noTrade = true;// Default setting for MyInput0
              // User defined variables (add any user defined variables below)
              #endregion
      
              /// <summary>
              /// This method is used to configure the strategy and is called once before any strategy method is called.
              /// </summary>
              protected override void Initialize()
              {
                  CalculateOnBarClose = true;
              }
      
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
                  if (noTrade == true)
                  {
                      EnterLong();
                      noTrade = false;
                  }
              }
      
              #region Properties
              [Description("")]
              [GridCategory("Parameters")]
              public int MyInput0
              {
                  get { return myInput0; }
                  set { myInput0 = Math.Max(1, value); }
              }
              #endregion
          }
      }
      2nd go to Ordres Tab and select NG06-10
      All prices should freeze now and Log should show error.

      Should also work if 2nd open chart NG06-10.

      Comment


        #4
        Hi purdey,

        As a test, can you see if you are able to replicate this behavior on ES using the same interval?
        KyleNinjaTrader Customer Service

        Comment


          #5
          No, ES works fine (I am runnin several strategies on different instruments on this interval and all but NG work).

          Comment


            #6
            purdey, I followed your steps but I was unable to reproduce this error. From the strategy tab I right-clicked -> new strategy -> NG 06-10 1 tick, default instrument settings -> enabled the strategy -> changed the selected instrument in the order tab to NG 06-10 and there was no crash. Then I created a new NG 06-10 1 tick chart, but still no crash. Is there anything you are doing differently?
            AustinNinjaTrader Customer Service

            Comment


              #7
              No, that is all I did, on my end it always and immediately produces the error. I could do a clean install and see if the error persists.

              Comment


                #8
                Please do so. Also, try restarting your computer. That seems to magically fix quite a few problems.
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  Did a restart, nothing changed, did a clean install, nothing changed, error pops up again.

                  Comment


                    #10
                    Hello purdey,

                    Please open the Instrument Manager by clicking Tools > Instrument Manager.
                    In the Instrument Manager, select NG from the list on the right, then click Change.

                    In the Definition tab of the Instrument Editor, you will see that two exchanges are enabled - Globex and Nymex.

                    Which of these two exchanges are you using when adding NG to your default instrument list?
                    KyleNinjaTrader Customer Service

                    Comment


                      #11
                      I always selected Nymex in the instrument manager when adding NG to a list. I now unchecked the Globex tick box on the definitions tab and the error seems to be gone!

                      Might there be a problem of the proper assignment of the choosen exchange i.e. when there are several exchanges to choose from it doesn't pick the selected?

                      Comment


                        #12
                        Hi purdey,

                        I'm glad to hear that this has done the trick for you.

                        Was this instrument added to your default instrument list prior to this, or were you selecting the instrument using a type setting of 'Future'?
                        KyleNinjaTrader Customer Service

                        Comment


                          #13
                          Initially NG was not on my default list, but I added and removed and added back NG to different lists. None of this worked.
                          When working with it I always selected it from a list I have added it to via the instrument manager, never selected it via the 'futures' type setting.

                          Comment


                            #14
                            Hi purdey,

                            Just to confirm, when you were adding NG to your default list, you were selecting Nymex and not just clicking the '<' button without selecting an exchange, correct?
                            KyleNinjaTrader Customer Service

                            Comment


                              #15
                              Yes, that's correct.
                              And thanks for your help!

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              597 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              343 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              556 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              555 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X