Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT 8 Bug or Feature? Zombie Indicator

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

  • sledge
    replied
    This was the one I wanted to find.

    Leave a comment:


  • NinjaTrader_Matthew
    replied
    You are correct that OnStatechange() is entered for all indicators which are compiled on the system. They do not have to be "Configured" on a chart (i.e., running).

    This would happen even if the indicator was never added and configured to a chart.

    Leave a comment:


  • Jim W.
    replied
    Originally posted by NinjaTrader_Matthew View Post
    Which States were you seeing printed after you removed it? In my testing, it only shows State.SetDefaults and State.Terminated.
    After Removed, I only remember seeing State.SetDefaults and State.Terminated.

    Please expand more on what you mean by "indicator is not actually running":

    Doesn't removing an Indicator from a Chart mean that it should not do anything on that Chart from then on?

    Are you saying that OnStateChange() is entered for all Indicators Compiled, not just the ones Added the Chart?

    Or, once Added OnStateChange() will always be called even after removed?

    Leave a comment:


  • sledge
    replied
    2 pages here.

    I had another thread I can't find right now.


    Leave a comment:


  • NinjaTrader_Matthew
    replied
    Which States were you seeing printed after you removed it? In my testing, it only shows State.SetDefaults and State.Terminated.

    Similar to the Initialize() method, OnStateChange() will be called for these two States mentioned above throughout the lifetime of the applications run time, even if it is not configured on a chart. This is expected behavior.

    The reason for this is the same as in NinjaTrader 7, when you open your indicators menu, there is a call to each of the indicators SetDefaults in order to generate the list of indicators you see displayed on the UI.

    In NinjaTrader 8 this process will now call State.Terminated as well.

    You should not see anything beyond these two states when the indicator is not actually running. But do let us know if you see otherwise and we'll be happy to look into.

    Leave a comment:


  • Jim W.
    started a topic NT 8 Bug or Feature? Zombie Indicator

    NT 8 Bug or Feature? Zombie Indicator

    I was trying to understand the onStateChange() method, so I created the simplest of NijaScripts that I called ShowState (attached). I generated the New Indicator from the Editor and added the line below to OnStateChange(). Changed nothing else.

    protected override void OnStateChange()
    {
    Print ("ShowState: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " State Change = " + State);
    if (State == State.SetDefaults)
    . . .
    }
    1) Opened NinjaScript Output Window and Added my ShowState Indicator to Chart.
    2) Immediately saw messages from ShowState in Output Window.
    3) After playing with various activities to watch the State Change I removed the Indicator from the Chart.
    4) To my amazement the ShowState messages continued to be written to the Output Window.
    5) Added ShowState back into the Chart and now the messages were doubled.
    6) Removed ShowState from Chart and single messages still written to Output Window.

    7) Created new Workspace named Zombie Demo
    8) Saved and copied workspace when new, after Indicator added, and after all Indicators removed.
    9) Restarted NT and still getting ShowState messages.
    10) Only way to kill the zombie was to set ShowState as Excluded From Compilation and Compile.

    Attached as Zombie message.jpg was created by:

    1) Open NT
    2) Open Output Window and Clear it.
    3) Select Indicators...
    4) Take snapshot of Indicators and Output Window.
    Attached Files
    Last edited by Jim W.; 10-21-2015, 02:25 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Mindset, Yesterday, 06:46 AM
0 responses
14 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
23 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
16 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
82 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
51 views
0 likes
Last Post PaulMohn  
Working...
X