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 caacapital, Today, 10:10 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by DiverG20, Today, 10:23 AM
    0 responses
    17 views
    0 likes
    Last Post DiverG20  
    Started by SuneSorgenfrei, Today, 09:29 AM
    0 responses
    16 views
    0 likes
    Last Post SuneSorgenfrei  
    Started by dodoei, Today, 07:24 AM
    0 responses
    14 views
    0 likes
    Last Post dodoei
    by dodoei
     
    Started by thecashguys, Today, 06:13 AM
    0 responses
    12 views
    0 likes
    Last Post thecashguys  
    Working...
    X