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 DJ888, Today, 10:57 PM
    0 responses
    6 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    7 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Working...
    X