Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Does losing connection trigger State.Terminated to run?

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

    Does losing connection trigger State.Terminated to run?

    Question 1:
    Does losing connection (unrecoverable, e.g. Internet dead for 30 minutes) cause State.Terminated and/or State.SetDefaults and/or State.Configure to trigger?

    Question 2:
    Does this page also apply to Indicators regarding connection timeout handling (it mentions Strategies, but does not mention Indicators): https://ninjatrader.com/support/help...sshandling.htm

    Thanks

    #2
    Hello firefoxforum12,

    "Does losing connection (unrecoverable, e.g. Internet dead for 30 minutes) cause State.Terminated and/or State.SetDefaults and/or State.Configure to trigger?"

    If the connection loss handling is set to Reload then the script would enter the terminated state and then data loaded state and then back to the historical > realtime state.
    If the connection loss handling is set to Keep running, the script would not reload.


    "Does this page also apply to Indicators regarding connection timeout handling (it mentions Strategies, but does not mention Indicators):"

    This would not apply to indicators, but the connection is fully disconnected and manually reconnected, this would reload historical data on the chart and would reload indicators.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello thanks. I noticed when I reconnect after disconnection it will recall State.Configure in my indicator. Is there a way to avoid this or? I only want it to be called when the user EDITS the indicator settings.

      I.e. it is NOT called once as per NinjaTrader documentation Click image for larger version  Name:	image.png Views:	0 Size:	16.6 KB ID:	1312849

      In my testing State.Configure is called when you edit something about the indicator setting (OK Great).

      But the big problem is its ALSO called when you reconnect an account manually! Why would it do that? Nothing about the indicator settings are changed yet this function is called and basically cooks my code that relies on only running stuff if the user made actual settings changes.
      Last edited by firefoxforum12; 08-04-2024, 07:25 PM.

      Comment


        #4
        Hello firefoxforum12,

        Reconnecting causes historical data to be reloaded which reloads all scripts on all charts. The script will go through State.Configure as it is reloaded.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks. Suggest this be included in the documentation as State.Configure says its run once. This is a huge omission imo.

          Comment


            #6
            Hello firefoxforum12,

            This will be run once per lifecycle. When scripts are reloaded this reloads the lifecycle.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            602 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            347 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            559 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            558 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X