Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Alert Never fires

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

    Strategy Alert Never fires

    Hi,

    No matter what I do I can't get NT to fire any alerts in my strategy. I can't even get it to fire an alert made via the wizard that does nothing other than fire an alert, e.g.

    Code:
    protected override void OnBarUpdate()
    {
        if (BarsInProgress != 0)
            return;
        // Set 2
        if (true == true)
        { 
            Alert(@"SampleIsFallingIsRising_1", Priority.Medium, [USER="137"]test[/USER], @"C:\Program Files (x86)\NinjaTrader 8\sounds\Alert1.wav", 0, Brushes.Transparent, Brushes.Yellow);
        }
    }
    I place a debug print right before my alert, I see it in the output window but the alert never fires and there is no error. I initiate an order right below the alert line and that also works, so there's no question the alert line is being hit. But regardless even the simple example above will not fire an alert for me.

    I've tried cutting and pasting the alert code from https://ninjatrader.com/support/help...nd_sharing.htm and that alert never fires for me either. I've checked the path to the alert file, I've tried changing the parameters, and same thing, no error and no alert.

    Am I missing something here this is driving me crazy, thank you!

    #2
    Hello ntcoder256,

    Thank you for your post.

    Does the alert appear in the alerts log but the sound doesn't play, or is it missing from the log as well?

    Is the strategy running in real time when you're not seeing the alert? That is, you're not running a backtest in the Strategy Analyzer or on a chart of historical data, are you?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello ntcoder256,

      Does the alert appear in the alerts log but the sound doesn't play, or is it missing from the log as well?
      If by alerts log you mean the log tab in the control center, no I don't see any message there about alerts.

      Originally posted by NinjaTrader_Kate View Post

      Is the strategy running in real time when you're not seeing the alert? That is, you're not running a backtest in the Strategy Analyzer or on a chart of historical data, are you?
      No, I'm testing it in playback mode, and I wasn't really expecting to see any alerts when backtesting and I don't. Are alerts only displayed for real time feeds, not playback?

      I just checked the docs and it mentions

      >1. This method can only be called once the State has reached State.Realtime. Calls to this method in any other State will be silently ignored.

      So it sounds like that's the case, sorry if so I'm new and am banging around docs trying to get things working quickly and missed that. I should know better and RTFM

      Comment


        #4
        Hello ntcoder256,

        Thank you for your reply.

        No, I would expect alerts to be triggered in playback once playback actually begins. Also, the Alerts log is not the same as the Log tab of the Control Center. To open an Alert Log window to view alerts, you can go to Control Center > New > Alerts Log. This will show the text you put in for the alert message if it's working correctly.

        If you test with the attached script, do you see results in the alerts window and can you hear the sound played? It should sound an alarm at the close of each bar on the chart in real time.

        Thanks in advance, I look forward to assisting you further.
        Attached Files

        Comment


          #5
          Originally posted by NinjaTrader_Kate View Post
          Hello ntcoder256,

          Thank you for your reply.

          No, I would expect alerts to be triggered in playback once playback actually begins. Also, the Alerts log is not the same as the Log tab of the Control Center. To open an Alert Log window to view alerts, you can go to Control Center > New > Alerts Log. This will show the text you put in for the alert message if it's working correctly.

          If you test with the attached script, do you see results in the alerts window and can you hear the sound played? It should sound an alarm at the close of each bar on the chart in real time.

          Thanks in advance, I look forward to assisting you further.
          Thanks yes it works and plays a sound.

          I copied your alert to my script and it works as well though I have no idea why yours does and mine doesn't, I'll try to figure that out later.

          One question though, I really want a popup with sound, but I only get the sound with your alert. I feel like I must be missing something obvious here, I thought if one includes a message string you'd also get a popup. I've also tried replacing the sound file with "" but that doesn't help.

          thanks!


          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
          44 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