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)
    {[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 Haiasi, Today, 06:53 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by ScottWalsh, Today, 06:52 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by ScottW, Today, 06:09 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by ftsc2022, 10-25-2022, 12:03 PM
    5 responses
    256 views
    0 likes
    Last Post KeyonMatthews  
    Started by Board game geek, 10-29-2023, 12:00 PM
    14 responses
    244 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Working...
    X