Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader stopped working error

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

    NinjaTrader stopped working error

    I get the attached error once I enable my strategy with my IB data feed. The strategy runs a few times/seconds before crashing.

    It does not crash when I enable and run it in market replay however. I have a version of this strategy on NT7 as well and it does not crash at all.

    Also attached are my log and trace files.

    Any clues would be appreciated...
    Attached Files
    Last edited by oliver1337; 12-11-2016, 10:27 PM.

    #2
    Please follow these steps to retrieve the reason NinjaTrader has most recently crashed from your Event Viewer. Larger clickable versions of these images are below.


    First, please open up your Control Panel. The Search box is in the upper right hand side. Please type "view event logs" into this box.


    Next, please click "View event logs" on the left


    Next, on the left side, drill down to Windows Logs -> Application. In the center, page down in the table (4) until you see "The program NinjaTrader.exe" in the lower box (5) . Once you see this, click the "Details" tab (6)


    Once here, please select the XML View radio button (7) . In the XML View (8), click in this window, press ctrl + a, observe all the text is now highlighted as it is in the picture, and press ctrl + c . Open up your favorite text editor (9) and press ctrl + v inside it. Observe the text is now inside your text editor. Save this file (10) as EventViewerLog.xml (11)


    IMPORTANT: If you see two or more similar errors next to each other, please send XML for all of these together.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi Jessica,

      I followed those steps and attached the event viewer log file as a .txt file as the forum wouldn't let me attached it as .XML...
      Attached Files

      Comment


        #4
        Thank you oliver1337. May I also ask, what version of NinjaTrader 8 are you using? You can check via the Control Center > Help > About menu. Please make sure you are using 8.0.2.0 which was just released if you are not already. There have been recent improvements to the IB adapter.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Hi Jessica,

          I am using the latest, 8.0.2 version that was released a week or so ago. It did not work on 8.0.1 either.

          Any ideas as to why this is occurring and how to fix it?

          Thanks

          Comment


            #6
            It looks like Windows did not give us quite enough information to say for certain, and the crash occurred before Ninja was able to write the reason why to its logs. I appreciate your patience with this process. Once I can see the same thing on my end as you are seeing on yours I will be able to say with certainty what has occurred. I would like to ask a few more diagnostic questions.

            If you would rather not send any of the below pieces of information to the forums you can send it to platformsupport[at]ninjatrader[dot]com referencing Attn:NinjaTrader_JessicaP and 1620390 in the subject line of your e-mail.

            When you were reviewing event viewer logs, were there no other messages tagged with a red "Error" label from NinjaTrader next to the one you sent information regarding?

            You mentioned this occurs with a strategy and with IB TWS. Are you able to make NinjaTrader crash running the SampleMACrossover strategy instead of your strategy?

            Would it be possible to receive a stripped-down copy of your strategy for testing?

            Please send me your log and trace files, templates, and other files, so that I may look into what occurred.
            You can do this by going to the Control Center-> Help-> Email Support.
            Please reference the following ticket number in the body of the email: 1620390
            Please include Attn:NinjaTrader_JessicaP in the body of your e-mail.
            IMPORTANT: Please also tick all the boxes in the "Other Files" section.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              I believe I have found the cause. In the Help Guide section on Instruments, it reads

              Originally posted by http://ninjatrader.com/support/helpGuides/nt8/en-us/instrument.htm
              Warning: The properties in this class should NOT be accessed within the OnStateChange() method before the State has reached State.DataLoaded
              Please move your call to retrieve Instrument.Fullname.substring for the master instrument to the State == State.DataLoaded section and retest your strategy.
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                Hi Jessica,

                That seems to work. The first time I enable the strategy though Ninjatrader crashes the exact same way... However if I open up ninjatrader after crashing and enable the strategy it seems to work.. I still have some more testing to do though to be sure.

                Also I just found a completely different issue.. I crash Ninjatrader 8 when I try to roll my contracts. Please see the attached log and screen cap.

                All I did was open ninjatrader8 go to tools - database management, then check the 6E and 6B contracts and clicked rollover..
                Attached Files
                Last edited by oliver1337; 12-15-2016, 11:35 PM.

                Comment


                  #9
                  There are currently known bugs with the rollover tool, which should be repaired in an upcoming version of NinjaTrader. I do not recommend using this tool for the time being. Please keep an eye on the release notes page for updates and bugfixes.

                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Jessica,

                    Thanks for the note about the rollover contract, I will avoid this.

                    Unfortunately, I have done some more testing and still crashes with the same error; even with the instrument moved to the data loaded state.

                    Will you please take another look into this?

                    Thanks!

                    Comment


                      #11
                      I am happy to look further into this. As a temporary debugging step, please hard-code an instrument value, rather than relying on Instrument.FullName. Please then let us know if your Strategy errors out at the same place. Whether or not it does we will assist further, this will just help us fence in what is occurring.
                      Jessica P.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks. I hard coded the instrument and it still errors the same. Again this works flawlessly on market playback but not with the IB live feed, making me think it isn't my code.
                        Last edited by oliver1337; 12-21-2016, 10:41 PM.

                        Comment


                          #13
                          I am reviewing with the code you sent us against different data feed providers, and will report back with my findings.
                          Jessica P.NinjaTrader Customer Service

                          Comment


                            #14
                            Hello oliver1337,

                            I was able to successfully get your strategy to run without errors with these changes :


                            • Removing your line that starts with "inst = " from OnStateChange
                            • Adding the following code to the beginning of OnBarUpdate

                            Code:
                                        foreach(int CurrentBarsI in CurrentBars)
                                        {
                                            if (CurrentBarsI < 14)
                                            {
                                                return;
                                            }
                                        }
                                        inst = Instrument.FullName.Substring(0, Instrument.MasterInstrument.Name.Length + 1).Trim();

                            I believe the reason your code worked previously may have been a mistake on my part. I habitually add that for loop to the beginning of many user code submissions, as it resolves a lot of queries like this one where there are not enough bars to trade, and may have forgotten I had done so before reporting back to you.


                            Please let us know if there are any other ways we can help. I am returning the copy which has been working for us to you via e-mail.
                            Jessica P.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi Jessica, these codes changes help but this issue is still unresolved for me. I still crash even with the new 5.1 update. So I have been using ninjatrader 7 for now.

                              It seems to be something to do the connection.

                              Could you please run and enable the script while you are connected to IB TWS for your live data? It will crash within a few mins.

                              Thanks,

                              Oliver

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              41 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              124 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              64 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              41 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              46 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X