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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X