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

Disposing a Private Series on Termination

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

    Disposing a Private Series on Termination

    Dear Support,

    Is it possible to dispose a private series ,MM, on termination? Neither of the following codes work. I get an error that NinjaTraderScript.Series<doubel> does not have a definition for "Dispose."

    Code:
     if (State == State.Terminated)
    {
    MM.Dispose();
    }
    or

    Code:
     private void OnTermination()
    {
    MM.Dispose();
    }
    What is the correct script to achieve either of the above examples.

    Many thanks.

    #2
    Hello aligator,
    Thanks for your post.

    There would be no reason to dispose of a series. What are you trying to do specifically?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JoshG View Post
      Hello aligator,
      Thanks for your post.

      There would be no reason to dispose of a series. What are you trying to do specifically?
      I am just converting a NT7 indicator that includes the above void script used on startup.

      I have removed the script for the NT8 conversion and it compiles and works fine. However, I wonder if something equivalent is needed for efficiency or "best practices."

      Thanks.

      Comment


        #4
        Thx dude, it is very interest for me

        Comment


          #5
          aligator,

          Without an example of Dispose() being used in the NT7 script it's tough to say. I personally believe it may have been a mistake that was never removed from the code.

          Nothing needs to be done on your end after using a Series as that would mostly be reserved for more complex items that are using resources. .
          Josh G.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_JoshG View Post
            aligator,

            Without an example of Dispose() being used in the NT7 script it's tough to say. I personally believe it may have been a mistake that was never removed from the code.

            Nothing needs to be done on your end after using a Series as that would mostly be reserved for more complex items that are using resources. .
            Thank you josh,

            Just curious that NT7 NinjaTraderScript.Series<doubel> has a definition for Dispose() but none in NT8. Is that an improvement, a missed item, or something that is no longer needed in new platform?

            Thanks again!

            Comment


              #7
              aligator,

              I'm betting that it was just a placeholder in NT7 or it may have been used internally.
              Josh G.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by RookieTrader, Today, 09:37 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by kulwinder73, Today, 10:31 AM
              0 responses
              5 views
              0 likes
              Last Post kulwinder73  
              Started by terofs, Yesterday, 04:18 PM
              1 response
              23 views
              0 likes
              Last Post terofs
              by terofs
               
              Started by CommonWhale, Today, 09:55 AM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Gerik, Today, 09:40 AM
              2 responses
              7 views
              0 likes
              Last Post Gerik
              by Gerik
               
              Working...
              X