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 NRITV, Today, 01:15 PM
              2 responses
              8 views
              0 likes
              Last Post NRITV
              by NRITV
               
              Started by frankthearm, Today, 09:08 AM
              7 responses
              31 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by maybeimnotrader, Yesterday, 05:46 PM
              5 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by quantismo, Yesterday, 05:13 PM
              2 responses
              19 views
              0 likes
              Last Post quantismo  
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              33 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X