• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Making an Alert on conditional indicator

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

    Making an Alert on conditional indicator

    Code:
    protected override void OnBarUpdate()
            {
                // Use this method for calculating your indicator values. Assign a value to each
                // plot below by replacing 'Close[0]' with your own formula.
    			
    			if (MACD(12,26,9).Diff[0] > 0 && MACD(12,26,9)[0] > 0)
          			BarColor = Color.Green;
    				
    			else if (MACD(12,26,9).Diff[0] < 0 && MACD(12,26,9)[0] < 0)
          			BarColor = Color.Red;
    			
            }
    How would you program this to play an audible alert on a green bar being made and a seperate one for the red bar color. THanks.

    #2
    Use PlaySound().

    Code:
    if (....)
    {
         BarColor = Color.Green;
         PlaySound(@"C:\mySound.wav");
    }
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by vpzdcv, Today, 02:31 AM
    0 responses
    3 views
    0 likes
    Last Post vpzdcv
    by vpzdcv
     
    Started by YevhenShynkarenko, Today, 01:22 AM
    0 responses
    7 views
    0 likes
    Last Post YevhenShynkarenko  
    Started by ttodua, Today, 12:52 AM
    0 responses
    4 views
    0 likes
    Last Post ttodua
    by ttodua
     
    Started by ttodua, Today, 12:50 AM
    0 responses
    2 views
    0 likes
    Last Post ttodua
    by ttodua
     
    Started by mulshah, Yesterday, 11:12 PM
    0 responses
    3 views
    0 likes
    Last Post mulshah
    by mulshah
     
    Working...
    X