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 FrancisMorro, Today, 03:24 AM
    0 responses
    1 view
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,770 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    31 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    944 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    11 views
    0 likes
    Last Post Max238
    by Max238
     
    Working...
    X