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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    61 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    198 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    364 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    283 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X