Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Play sound when ProfitTarget or StopLoss is executed

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

    Play sound when ProfitTarget or StopLoss is executed

    How would you program it so that when the ProfitTarget or StopLoss is hit, it plays a sound?

    #2
    Hi,

    You can use the OnExecution method to check for an execution event, where you can then check for a specific execution name, at which point call the PlaySound() method:

    Code:
    		protected override void OnExecution(IExecution execution)
    		{		
    			
    			if(execution.Name == "myProfitTarget")
    			{
    				PlaySound(mySoundFile);
    			}
                    }
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X