• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 stafe, Today, 01:27 PM
              0 responses
              2 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by Seastragg, Today, 01:21 PM
              0 responses
              10 views
              0 likes
              Last Post Seastragg  
              Started by Dagamos, Today, 11:48 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_RyanS  
              Started by kantkant2, Yesterday, 03:20 PM
              4 responses
              25 views
              0 likes
              Last Post eDanny
              by eDanny
               
              Started by EnveousColnago, Today, 11:50 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Working...
              X