Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to read Alerts from Alert Windows?

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

    How to read Alerts from Alert Windows?

    Anyone got any examples of code on how to read all the alerts, read the message id priority etc.

    #2
    Hello,

    It appears you can find this information using NinjaTrader.NinjaScript.Alert.AlertHistory. Here is an example iterating over the collection:

    Code:
    foreach (KeyValuePair<string, IEnumerable<AlertEventArgs>> baseAlert in NinjaTrader.NinjaScript.Alert.AlertHistory)
    {
    	foreach (AlertEventArgs alertEventArgs in baseAlert.Value)
            {
                 Print("id: " + alertEventArgs.Id + " instrument: " + alertEventArgs.Instrument.FullName);
            }     
    }

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    246 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    160 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    165 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    250 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    201 views
    0 likes
    Last Post CarlTrading  
    Working...
    X