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 SantoshXX, Today, 03:09 AM
    0 responses
    6 views
    0 likes
    Last Post SantoshXX  
    Started by DanielTynera, Today, 01:14 AM
    0 responses
    2 views
    0 likes
    Last Post DanielTynera  
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    41 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    12 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Working...
    X