Announcement

Collapse
No announcement yet.

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 vibrationketousa, Today, 12:26 AM
              0 responses
              1 view
              0 likes
              Last Post vibrationketousa  
              Started by vibrationketousa, Today, 12:24 AM
              0 responses
              2 views
              0 likes
              Last Post vibrationketousa  
              Started by hdge4u, Yesterday, 09:09 PM
              0 responses
              18 views
              0 likes
              Last Post hdge4u
              by hdge4u
               
              Started by hdge4u, Yesterday, 09:02 PM
              0 responses
              9 views
              0 likes
              Last Post hdge4u
              by hdge4u
               
              Started by stormcloudseven, Yesterday, 08:41 PM
              1 response
              9 views
              0 likes
              Last Post DavidTrades  
              Working...
              X