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 jeronymite, 04-12-2024, 04:26 PM
              3 responses
              44 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              20 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by AttiM, 02-14-2024, 05:20 PM
              10 responses
              179 views
              0 likes
              Last Post jeronymite  
              Started by ghoul, Today, 06:02 PM
              0 responses
              10 views
              0 likes
              Last Post ghoul
              by ghoul
               
              Started by DanielSanMartin, Yesterday, 02:37 PM
              2 responses
              13 views
              0 likes
              Last Post DanielSanMartin  
              Working...
              X