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

Long running function in State.Terminated

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

    #16
    Hello Chris!

    Thank you very much for the support.
    Any estimations when new update will be released?

    Comment


      #17
      Hello,

      Thank you for the reply.

      There should be an update rolling out early next month or so. I will update this forum post once it is released.

      Please let me know if I may be of any further assistance.
      Chris L.NinjaTrader Customer Service

      Comment


        #18
        Hello,

        NinjaTrader 8 R12 was released. This issue has been fixed.

        Chris L.NinjaTrader Customer Service

        Comment


          #19
          Hello Chris!

          Sorry for the long delay with reply. I’ve been testing different ways to ensure proper termination of my indicators, what has taken time. Let me know, if I need to create another thread.

          After R12 update, I can see OnWindowDestroy for Control Center window. Thank you. At the same time there is still one issue: Control Center OnWindowDestroy can come at any time: before termination message is sent to all indicators or after it was sent to some. So, if AddOn cleanup is done in OnWindowDestroy (as it is recommended in documentation) and indicators need to use functions from AddOn in their State.Terminated, you can’t be sure that required resources are still exist in AddOn. This makes code much more complicated (corresponding checks, locks etc) and is increasing running time of the code in State.Terminated
          Therefore the question:
          Can you consider the possibility to send OnWindowDestroy of Control Center window after all other windows are closed or, to be more precise, after State.Terminated is finished in all indicators?


          In fact, all my issues are happening because State.Terminated is not always arriving to the indicators as well as to the AddOn (see first post in this thread) . To illustrate this, I’ve modified an example from the first post.
          Closing NT8 while attached code is running on 10+ charts will show that State.Terminated is not send to all indicators or, sometimes, even it has arrived, its execution is not finished. Hence another set of questions:
          1. Is that a correct behavior of NT8 that State.Terminated is not always arriving to the indicators?
          2. Is that a correct behavior of NT8 that State.Terminated is not always finished (I suspect the thread is closed).

          Thank you very much in advance
          GmA
          Attached Files

          Comment


            #20
            Hello.

            Thanks for the follow up.

            I am inquiring with our product management team to see if this behavior is expected. I can confirm that the termination state was not complete for an instrument in my testing of your script.

            I will reply with my findings shortly.
            Chris L.NinjaTrader Customer Service

            Comment


              #21
              Hello Chris!

              Thank you.
              Will be waiting for your reply

              Kind regards
              GmA

              Comment


                #22
                Hello Chris!

                One additional observation.
                I am using 3 data connections: Continuum (for futures), FXCM (for forex) and Kinetick (for End of Day).
                After loading Test indicator on 15 charts (5 per each data feed) I've disconnected all 3 data feed and have connected them back in few minutes. State.Terminated has been received by only 10 charts.

                Not sure if this is important, but better I'll share it.

                Thank you
                GmA

                Comment


                  #23
                  Hello Chris!

                  Sorry for bothering.
                  Any update from product management team?

                  Thank you very much in advance
                  GmA

                  Comment


                    #24
                    Hello.

                    Thanks for the follow up.

                    We are still waiting on a confirmation to see if this is expected or not. If it turns out to be expected, I would submit a feature request to have this changed.

                    Please let us know if you have any questions.
                    Chris L.NinjaTrader Customer Service

                    Comment


                      #25
                      Hello Chris!

                      Any further update?

                      Thank you in advance
                      GmA

                      Comment


                        #26
                        Hello.

                        Sorry, but there is no update for this item at this time. I will update this thread when I learn any news.

                        Please let us know if you have any questions.
                        Chris L.NinjaTrader Customer Service

                        Comment


                          #27
                          Hello Chris!

                          Did you get any update from Product Management Team?

                          Thank you in advance
                          GmA

                          Comment


                            #28
                            Hello gma17,

                            Thanks for the follow up.

                            This item has been reported to the development team and will be changed in later revisions.

                            When this issue gets solved it will be posted on our release notes page below:



                            Please refer to that page whenever an update is released to keep track of bug fixes and feature additions.

                            Please let us know if you have any questions.
                            Chris L.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by ruudawakening, Today, 12:58 AM
                            1 response
                            8 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by i019945nj, 12-14-2023, 06:41 AM
                            4 responses
                            64 views
                            0 likes
                            Last Post NinjaTrader_BrandonH  
                            Started by thread, Yesterday, 11:58 PM
                            1 response
                            8 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by stafe, Yesterday, 08:34 PM
                            1 response
                            16 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by jclose, Yesterday, 09:37 PM
                            1 response
                            11 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Working...
                            X