Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Alert if Strategy is disabled automatically on connection loss

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

    Alert if Strategy is disabled automatically on connection loss

    Hi!

    I want to get an alert only when my automated strategy is disabled automatically by NT.


    Code:
    else if (State == State.Terminated)
    {[INDENT]Alert("DisabledAlert", Priority.High, "Strategy disabled", NinjaTrader.Core.Globals.InstallDir + @"\sounds\Alarm1.wav", 60, Brushes.Black, Brushes.Red);[/INDENT]
     
    
     }
    If I just turn off my internet connection, NT disables the strategy after a while and I get an alert as expected. However, I am also getting an alert if I disable the strategy manually. Is there a way to exclude the alert when I disable it manually?


    Thanks in advance!
    Last edited by KirkHammett; 11-28-2021, 04:54 AM.

    #2
    Hello KirkHammett,

    There is an OnConnectionStatusUpdate() override that can let you know when the connection is lost or reconnected.
    https://ninjatrader.com/support/help...atusupdate.htm

    However, for a full disconnection (and not a connection loss), there would not be a way to distinguish if this is due to a manual disconnection.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X