Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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)
    {
    Alert("DisabledAlert", Priority.High, "Strategy disabled", NinjaTrader.Core.Globals.InstallDir + @"\sounds\Alarm1.wav", 60, Brushes.Black, Brushes.Red);
    }
    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, 03: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 Bhavika, Yesterday, 09:03 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by slimcactus, Today, 10:26 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Monares, Today, 10:49 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_JustinD  
    Started by d122y, Today, 10:20 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by trader3000a, Today, 06:41 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X