• 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 PG7940, Today, 04:26 AM
    0 responses
    2 views
    0 likes
    Last Post PG7940
    by PG7940
     
    Started by marcus2300, Today, 02:25 AM
    0 responses
    2 views
    0 likes
    Last Post marcus2300  
    Started by drpapp, 01-24-2019, 06:57 AM
    5 responses
    69 views
    0 likes
    Last Post pjsmith
    by pjsmith
     
    Started by plydcv, Today, 12:40 AM
    0 responses
    3 views
    0 likes
    Last Post plydcv
    by plydcv
     
    Started by Sh00tHerMcGavin, Yesterday, 07:39 PM
    0 responses
    4 views
    0 likes
    Last Post Sh00tHerMcGavin  
    Working...
    X