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? )...


        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.

          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.

              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 algospoke, Yesterday, 06:40 PM
                  2 responses
                  19 views
                  0 likes
                  Last Post algospoke  
                  Started by ghoul, Today, 06:02 PM
                  3 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  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
                  180 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X