Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnMarketDepth stops generating data

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

    OnMarketDepth stops generating data

    Hello! I have a strategy, working with OnMarketDepth it is working with an ES-06-21 instrument everything is going well it generates values ​​at levels until at some point for no apparent reason without generating errors it stops entering the OnMarketDepth method and of course I can no longer receive any value, could you tell me if there is a specific reason to stop bringing data, or something that causes this, thank you very much.

    #2
    Hi Robert, thanks for your post.

    Please check in the log tab of the Control Center for any possible errors. It sounds like the strategy is experiencing an unhandled exception then disabling itself. Can you confirm if the strategy keeps running after OnMarketData stops or is it getting disabled on its own?

    You can also test what is happening by adding a Print() at the top of OnMarketData just to make sure it is running.

    Best regards,
    -ChrisL


    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello NinjaTrader_ChrisL


      I have some prints placed in both methods as both methods have try catch, the strategy continues to run but only the prints from OnBarUpdate continue to appear but not from OnMarketDepth, then it works for a certain time until OnMarketDepth stops working so I must deactivate and activate the strategy to make it work again.

      Comment


        #4
        Hi Robert, thanks for your reply.

        If you remove the try-catch from OnMarketData do you get an unhandled exception or does any error surface? Also make a test strategy that only overrides OnMarketData and uses Print to print out data, does that stop printing at any point. If not the issue is specific to your strategy and it should be reduced down to find this error.

        Best regards.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi NinjaTrader_ChrisL, thanks for helping me with this.


          I'm going to show you the code I'm using, I don't know if you can notice something strange here, I'm doing a very simple test in which I capture values ​​in OnMarketDepth and print them in OnBarUpdate and the exact same thing happens to me, in fact the code is without the try catch so you can see it better.



          Attached Files

          Comment


            #6
            Hi Robert, thanks for your reply.

            I don't see anything wrong but try making this kind of strategy that simply inherits from Strategy and not this GenericRealtimeStrategy class. This might have something to do with the problem you are seeing but I can be sure. It's not recommended to go beyond the Strategy level of inheritance because there are internal object creation factories in NinjaTrader that create strategy objects and doing this can break something.

            Best regards,
            -ChrisL
            Chris L.NinjaTrader Customer Service

            Comment


              #7

              Hi Chris L.

              Ok, what I did was remove the inheritance and put only Strategy, I also removed the rest of the logic that I had for the strategy and leave only 2 prints, one in OnMarketDepth and another in OnBarUpdate, it happens the same print both but there comes a time that it only shows the print of OnBarUpdate and does not go into OnMarketDepth

              Thank you.!
              Attached Files

              Comment


                #8
                Hi Robert,

                I do not get a stop of OnMarketData calls using Kinetick. I will need to send me your log and trace files to know if there is an issue on your end.

                You can do this by going to the Control Center-> Help-> Email Support

                Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

                Please reference "Attn ChrisL 3132889 <past forum link here>" in the body of the email.

                Best regards,
                -ChrisL
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Robert, thanks for sending those in.

                  The only problem I am seeing in your log and trace is internet disconnections which would cause OnMarketData to stop working. Please reset your modem, router, and PC and test the strategy again. Monitor the Log tab of the Control Center for disconnections while your strategy is running. Make sure your PC is connected through Ethernet and your internet service provider is DSL or Cable (no satellite/4G/5G internet providers)

                  Best regards,
                  -ChrisL


                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10

                    Hi Chris L.

                    I have carried out the same test in another environment that I have working, where the internet is more stable, it does not have crashes and I have the updated version of ninja and I suffer the same problem, I cannot maintain the strategy generating information because it slows down at some point, it can be any time OnMarketData stops generating values. Best regards.

                    Many thanks.

                    Comment


                      #11
                      Hi Robert, thanks for your reply.

                      I am sorry but I was not able to reproduce this. If you can give me a script that will reproduce this I will test it out again. Please do a full reinstall to test in a clean environment:
                      • Close all running applications.
                      • Navigate to your Documents folder > Right click on the 'NinjaTrader 8' folder > Rename > rename the folder to 'NinjaTrader 8 OLD'. DO NOT delete this folder.
                      • Uninstall NinjaTrader within Windows Control Panel.
                      • Navigate to C:\ > Program File (x86) > Delete the 'NinjaTrader 8' folder if it exists
                      • Reboot your PC.
                      • Once these steps are completed, download and install NT8 from the link below.
                      Chris L.NinjaTrader Customer Service

                      Comment


                        #12

                        Hi Chris L.


                        I did everything you told me to do, I started that strategy and the same thing happens to me, I don't know if when you tried it you waited a considerable time it could happen to 20 minutes as in 1 hour there is no fixed time in which it stops generating something from MarketDepth.


                        I put a capture of what it generates in the OutPut there comes a time that only prints OnBarUpdate and I pass you another capture with the parameters of how I am adding the strategy that happens to you.


                        Thanks a lot.
                        Attached Files

                        Comment


                          #13
                          Hi Robert,

                          If you test the script I attached do you get this problem? Can you record a video for me to demonstrate that OnMarketData is stopping in this test script? You will need to upload it to Youtube, Google drive, or dropbox to post it here. Also you can open up a T&S window from the New menu, does this feed stop after a certain amount of time? If you do get the issue with a clean installation I would say it is still either your hardware or network causing this issue.

                          Best regards.
                          Attached Files
                          Chris L.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Chris L.




                            In this video I have 2 strategies running mine that stops entering OnMarketDepth and the one you passed me that works with OnMarketData, This always brings information but it is not what I need, I need to access lv II, that's why I use OnMarketDepth, in the video you can see that I activate both strategies at the same time practically and after a while only the prints are seen in OutPut 2 of OnBarUpdate then I disconnect the strategy and show the Log in which no type of disconnection with the kinetick account or some other error is seen, everything works normally only that is, that the strategy stops entering that method, I put it to Run early since the market opened but it took me a while to present the problem, that's why the video that I passed to you is shorter because the previous one had a duration of almost 4 hours.

                            Thank you very much again..

                            Comment


                              #15
                              Hi Robert, thanks for your reply.

                              I understand it is OnMarketDepth that is stopping, not MarketData. Sorry for the confusion. Another test you can do is simply print DateTime.Now from OnMarketDepth. Let me know if you see the prints stop coming from that test. If this still happens on your end, we would need you to test on a different computer and/or a completely different network and check if you see the problem from the completely new environment. Please also connect your computer to the internet via Ethernet instead of Wifi if possible.

                              Best regards,
                              -ChrisL
                              Chris L.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post quantismo  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              8 responses
                              167 views
                              0 likes
                              Last Post jeronymite  
                              Started by cre8able, Today, 04:22 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post cre8able  
                              Started by RichStudent, Today, 04:21 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post RichStudent  
                              Working...
                              X