• 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

Removed indicators don't really disappear?

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

    Removed indicators don't really disappear?

    Restarting NT doesn't clean them up... I mean they are 'gone' - but the OnStateChange is still being called.

    Creating a new workspace, and closing the old chart and old workspace - this print's still remain.


    1) Create Chart.
    2) Add SMA2 below, which is SMA, with print statements in OnStateChange.
    3) Remove SMA2.

    Anytime you go back into indicators - the OnStateChange for the removed indicators is still called... something isn't being released?

    In the attached image - you can see other previously removed OnStateChanges are being called from 2 other indicators I had removed.
    Attached Files

    #2
    UPDATE:

    It appears ALL indicators OnStateChange are called.

    I created a totally new indicator, added a Print in OnStateChange - did not add it to the chart, and it is being processed.

    So it's not really a new object then since it was never created... For some reason all OnStateChanges of every indicator are being called ...

    Comment


      #3
      Originally posted by sledge View Post
      UPDATE:

      It appears ALL indicators OnStateChange are called.

      I created a totally new indicator, added a Print in OnStateChange - did not add it to the chart, and it is being processed.

      So it's not really a new object then since it was never created... For some reason all OnStateChanges of every indicator are being called ...
      That sounds like the code that used to be in Initialize() in NT7 that called all indicators, is now being run from State == State.Configure in OnStateChange().

      Comment


        #4
        Originally posted by koganam View Post
        That sounds like the code that used to be in Initialize() in NT7 that called all indicators, is now being run from State == State.Configure in OnStateChange().
        Thought this sounded familiar...

        Finally found where I had read it before..(I might try reading more of the nt8 information)..

        (Didn't expect it to still be around though... Why does it need called? )...


        http://www.ninjatrader.com/support/f...12&postcount=4

        Comment


          #5
          OnStateChanged will be called for all indicators as you open the indicator dialog. Since we have to dig into all indicators to get their names and default properties which triggers State.SetDefaults.

          This is the equivalent of "Initialized" in NT7.

          However as you close the indicator dialog each instance should be cleaned up and you'll see State.Terminated get called.

          Therefor should be no 'leak' here. Your indicator only really starts up as State.Configure gets called.
          BrettNinjaTrader Product Management

          Comment


            #6
            Originally posted by NinjaTrader_Brett View Post
            OnStateChanged will be called for all indicators as you open the indicator dialog. Since we have to dig into all indicators to get their names and default properties which triggers State.SetDefaults.

            This is the equivalent of "Initialized" in NT7.

            However as you close the indicator dialog each instance should be cleaned up and you'll see State.Terminated get called.

            Therefor should be no 'leak' here. Your indicator only really starts up as State.Configure gets called.
            What you described is kind of what we thought would happen: sledge's results seem to be suggesting that the "process all classes" code may be running from State.Configure rather than State.SetDefaults.

            Comment


              #7
              I see the issue, yes we needed to look into that will get back shortly. Thanks Guys.
              BrettNinjaTrader Product Management

              Comment


                #8
                I've spent some time this morning testing all scenarios I can think of and I'm not able to isolate any behavior when State.Configure is being called across all objects.

                The only behavior I see is State.SetDefaults and State.Terminated, which is expected to be called just like we saw with Initalize() and OnTermination() for the reasons stated by Brett above.

                I'd be very interested to know where State.Configure as being called when the indicator was not configured (i.e., not on a chart, not in a workspace, etc). Let me know if you guys see that behavior and I'll be happy to run that in.

                Thanks.
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Originally posted by NinjaTrader_Matthew View Post
                  I've spent some time this morning testing all scenarios I can think of and I'm not able to isolate any behavior when State.Configure is being called across all objects.

                  The only behavior I see is State.SetDefaults and State.Terminated, which is expected to be called just like we saw with Initalize() and OnTermination() for the reasons stated by Brett above.


                  Thanks.
                  Thanks. I re-looked at everything and only see SetDefaults being called....as was in my original image posted.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by pstrusi, Today, 02:05 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post pstrusi
                  by pstrusi
                   
                  Started by Seastragg, Today, 01:21 PM
                  1 response
                  17 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by stafe, Today, 01:27 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post stafe
                  by stafe
                   
                  Started by Dagamos, Today, 11:48 AM
                  2 responses
                  13 views
                  0 likes
                  Last Post Dagamos
                  by Dagamos
                   
                  Started by kantkant2, Yesterday, 03:20 PM
                  4 responses
                  25 views
                  0 likes
                  Last Post eDanny
                  by eDanny
                   
                  Working...
                  X