Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The strategy freezes and freeze chart.

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

    #61
    Hello, alrafer

    For all this time, after a multiple experiment on different PCs, I found only two things that really help:

    1. Send all orders event (submit, change, cancel) form 5 seconds time-series only.
    Limiting minimal delay between orders event not helps. Adding of a 5 sec bars and sending one (or two) event per bar only helps.

    2. Use as powerful PC, as possible. On a "very powerful PC", maybe you could use 3 (or 2) second bars.

    Hope this helps.
    Hope, even more, that once upon a time we will run HFT strategies on NT, because in other aspects NT works fast.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    Comment


      #62
      That is a good point Kate - perhaps reinstalling could help (even if we experienced this in two different VMs in Azure so far, Windows11 and Windows10). Testing this issue in general is not too easy given it only happened once in Simulation - and almost always with the real money account, but I am working on it.

      Could it be related to the VM location - in Azure - for any reason?

      Thank you.

      Comment


        #63
        Hello alrafer,

        Thank you for your reply.

        Not for any reason I'm aware of, however, my knowledge of virtual machines running in Azure is limited.

        Please let us know if we may be of further assistance to you.

        Comment


          #64
          Thanks for your answer fx.practic . I'll try a few things based on what you suggest up there.

          Cheers.

          Comment


            #65
            Originally posted by fx.practic View Post

            For all this time, after a multiple experiment on different PCs, I found only two things that really help:

            1. Send all orders event (submit, change, cancel) form 5 seconds time-series only.
            Limiting minimal delay between orders event not helps. Adding of a 5 sec bars and sending one (or two) event per bar only helps.
            See this post (https://ninjatrader.com/support/foru...43#post1179343) for the general idea of a delay approach I've been using with success to reduce freezes. The almost imperceivable delay it creates seems to be enough.
            Trade Above, LLC
            NinjaTrader Ecosystem Vendor - tradeabove.com

            Comment


              #66
              Hello, TradeAbove_Josh

              Sorry for the late answer, and thanks for the idea.
              If I am not mistaken, I tried similar solution and got freezing from time to time.
              Right now I have an excellent opportunity for the next round of fight with freezing issue - and I will implement what you advising.
              And will report about results.

              By the way, I found that if to run a Timer on State.Historical - it successfully detecting freezing by absence of new ticks or MarketData events.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #67
                Originally posted by fx.practic View Post
                Hello, TradeAbove_Josh

                Sorry for the late answer, and thanks for the idea.
                If I am not mistaken, I tried similar solution and got freezing from time to time.
                Right now I have an excellent opportunity for the next round of fight with freezing issue - and I will implement what you advising.
                And will report about results.
                Sounds good, I'm interested if our findings will align.

                Originally posted by fx.practic View Post
                By the way, I found that if to run a Timer on State.Historical - it successfully detecting freezing by absence of new ticks or MarketData events.
                If I understand you correctly, you're using a timer to periodically check if new ticks have come in since the last check to determine if the strategy is likely frozen? I can see this being useful for triggering a notification (email, text, etc) to the user.
                Trade Above, LLC
                NinjaTrader Ecosystem Vendor - tradeabove.com

                Comment


                  #68
                  I checked for new tick (strategy used 1 tick data-series) and OnMarketData events (why to use both? - because of paranoia).
                  If no any events happened for 30 seconds (for ES futures), strategy started to send emails and positing to Telegram (very convenient) each 5 mins.
                  That was reliable.
                  I used simple System.Timers.Timer.
                  fx.practic
                  NinjaTrader Ecosystem Vendor - fx.practic

                  Comment


                    #69
                    Thanks, it's a good precaution to include.
                    Trade Above, LLC
                    NinjaTrader Ecosystem Vendor - tradeabove.com

                    Comment


                      #70
                      Hello NT,

                      Wanted to submit my vote for this freezing issue to be resolved asap please.
                      Thanks to everyone here who have provided details of your experience.
                      I've just gone through almost 2 days of trying to troubleshoot & possible steps to avoid.
                      Everything is already documented here it looks like.
                      Kudos & special thanks to fx.practic - you are brilliant.

                      Thank you to everyone at NinjaTrader also for all your awesome support whenever it's needed.

                      Comment


                        #71
                        Hello Algotrade 12,

                        Thank you for your reply.

                        I have added a vote for you to SFT-5163 as well.

                        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

                        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

                        Please let us know if we may be of further assistance to you.

                        Comment


                          #72
                          Originally posted by NinjaTrader_Kate View Post
                          Hello Algotrade 12,

                          Thank you for your reply.

                          I have added a vote for you to SFT-5163 as well.

                          As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

                          Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

                          Please let us know if we may be of further assistance to you.
                          Hi Kate,

                          I'm just seeing your post now and so appreciative of your awesome/helpful support!

                          I'm sure fx.practic will be too.

                          Thanks so much again!

                          Comment


                            #73
                            Is there any update on a resolution to this issue? It continues to rear its head. Very difficult to reproduce.

                            Most recent occurrence immediately followed an order cancellation. The "Cancelled custom managed order: orderId='<#>'" msg is printed to the trace which confirms NT receives the action but OnOrderUpdate() is never called / the cancellation is not processed and the chart freezes. This particular order config is not overbearing - 2 profit target orders, 2 stop loss orders. The cancellation occurs as part of a trade closure by the strategy, where all pending orders (4 in this case) are looped through and cancelled (StrategyBase.CancelOrder()) and then a market order is submitted to flatten the outright position.
                            Trade Above, LLC
                            NinjaTrader Ecosystem Vendor - tradeabove.com

                            Comment


                              #74
                              Hello TradeAbove_Josh,

                              Thank you for your reply.

                              There is no update on SFT-5163 at this time.

                              There are many factors involved including but not limited to:
                              • Demand which is measured by objective user requests and subjective discretion on the part of our Product Management team.
                              • Feasibility
                              • Developer bandwidth
                              • Current projects in the queue
                              • Economics
                              You'll find a note regarding the request in the release notes when/if a request is implemented.

                              That being said this doesn't sound like the same issue here, but we would have to look into that to be certain. I'd suggest writing in to us directly from the platform (Help > Email to Support) and ensuring you check the box to send your log and trace files as we'd want to look at those, but we'd rather you not post them here as they may contain personally identifiable information. We can take a look at the log and trace to see if there's something else going on that potentially could cause freezing behavior. If you put a brief description of the behavior you're seeing in the body of the email that will help us route it to the correct place.

                              Please let us know if we may be of further assistance to you.

                              Comment


                                #75
                                Originally posted by TradeAbove_Josh View Post
                                Is there any update on a resolution to this issue? It continues to rear its head. Very difficult to reproduce.

                                Most recent occurrence immediately followed an order cancellation. ...

                                The cancellation occurs as part of a trade closure by the strategy, where all pending orders (4 in this case) are looped through and cancelled (StrategyBase.CancelOrder()) and then a market order is submitted to flatten the outright position.
                                Hi Josh,

                                I am curious are you seeing this a lot during live production or via simulation? I see this mostly during use of Simulation.


                                "where all pending orders (4 in this case) are looped through and cancelled" I also see this when executing numerous Cancels or Changes in rapid sequence.
                                .. ESPECIALLY when running the strategy through the chart rather than the Control Center.

                                All of my hours of debugging this issues point to the chart and BarType execution freeze being due to deadlocks involving NinjaTrader.Cbi... and most often when a heavy cross-thread UI update is involved.

                                What I have done to try to limit the issue: reduce dependencies on Locks and hobble my use of NinjaTrader Chart UI functionality.
                                • Run the strategies only via the control center, only use the charts to monitor but not to execute the strategies
                                • Add a 50 MilliSecond delay between consecutive Change or Cancel orders.
                                • Not yet sure it helps but when possible send a Account.CancelAllOrders() rather than individual cancels so I am only personally initiating one locking event against the huge Account and Orders objects rather than four in succession.
                                • Have not tried this yet but it is the next step. Why send four Cancel requests in sequence? Again so my code is the source of fewer lock requests all orders to cancel a single list and send just one Cancel Request via Account.Cancel(new[] { stopOrder, targetOrder .. etc }).
                                • This is such a problematic and risk generating bug I gave up running strategies through charts and the use of ChartTrader to monitor strategy execution and now have switched to pairing key strategies with an indicator that mimics all order entries and exits on the chart. I monitor strategy execution via the many wonderful windows of the Control Center. Now my strategy order submissions do still have Control Center UI interdependencies but no longer have any Chart UI interdependencies.
                                Edit: I am adding links to these additional posts from above in case someone finds this thread and is looking for a collection of mitigation tips.

                                Mitigation Tips from fx.practice ~order from a 5 second chart
                                https://ninjatrader.com/support/foru...09#post1179409

                                Mitigation Tips from Josh ~sequence order submission by chaining execution status
                                https://ninjatrader.com/support/foru...43#post1179343

                                Note that thus far it appears that all this above are just mitigations and not yet fixes.


                                Hedge

                                Last edited by hedgeplay; 06-10-2022, 08:43 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, Yesterday, 05:17 AM
                                0 responses
                                75 views
                                0 likes
                                Last Post NullPointStrategies  
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                146 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                79 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                50 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                54 views
                                0 likes
                                Last Post TheRealMorford  
                                Working...
                                X