Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Alert() not working in strategy

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

    Alert() not working in strategy

    I am attempting to set some alerts in a strategy I am developing and I am having a few issues.

    I was originally suspect that the problem was coming from my sound file path.
    I have the following code

    Code:
    string _soundRootPath;
    string _alarmOpenSession = "zSessionOpen.wav";
    
    _soundRootPath = NinjaTrader.Core.Globals.InstallDir + @"\sounds\" ;
    
     
    string sndFile = _soundRootPath + _alarmOpenSession;
    
    Alert("id", Priority.High, "message", sndFile, 30, Brushes.Blue, Brushes.White);
    
    with the above code I am getting the following value for sndFile
    "C:\\Program Files (x86)\\NinjaTrader 8\\\\sounds\\zSessionOpen.wav"

    With the above code, I do not receive an alert in my alert window, nor do I hear a sound. To see if this is associated with a bad sound path, I replaced the Alert() statement above with the following ...

    Code:
    Alert("id", Priority.High, "message", "Alert1.wav", 30, Brushes.Blue, Brushes.White);
    
    With either statement the Alert window has no alert and the sound doesn't play.

    This is being implemented in a strategy

    #2
    Hello jeliner,

    Thank you for your post.

    If you add a Print() line in the same condition when it returns true do you see the print in the Output window?

    Print(): http://ninjatrader.com/support/helpG...n-us/print.htm

    I look forward to your response.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Franck Z, Today, 09:49 AM
    0 responses
    5 views
    0 likes
    Last Post Franck Z  
    Started by pvtrader, Today, 08:02 AM
    2 responses
    7 views
    0 likes
    Last Post pvtrader  
    Started by Natoc, Today, 03:04 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by Rudy2323, Today, 02:56 AM
    2 responses
    28 views
    0 likes
    Last Post Rudy2323  
    Started by tonynt, Yesterday, 02:07 PM
    1 response
    38 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X