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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            46 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            22 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            33 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            50 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            42 views
            0 likes
            Last Post CarlTrading  
            Working...
            X