I need an audio alert on MT5 when TP or SP reached

 
I am new to using MT5, after using Ninjatrader, and I can't believe that a trade's SP or TP can be reached and the trade ends and there is no alert noise to inform me. To me this is a basic requirement for a platform and I can't believe it is not on MT5. I can't find a solution. Do MT5 traders simply work in silence? Or am I missing something? I believe I saw an advert for a file you can use for Mt4 but I can find nothing for MT5. It is such a simple thing - am I the only person who wants such an alert ?  
 
Guy Hobbs:
I am new to using MT5, after using Ninjatrader, and I can't believe that a trade's SP or TP can be reached and the trade ends and there is no alert noise to inform me. To me this is a basic requirement for a platform and I can't believe it is not on MT5. I can't find a solution. Do MT5 traders simply work in silence? Or am I missing something? I believe I saw an advert for a file you can use for Mt4 but I can find nothing for MT5. It is such a simple thing - am I the only person who wants such an alert ?  

You can use the alerts tab on the Toolbox. Add your SL and TP and tell it what sort of alerts that you want.

Or, find an ea or script on codebase. I think that this is how the majority of us do it.
 
Michael Charles Schefe #:

You can use the alerts tab on the Toolbox. Add your SL and TP and tell it what sort of alerts that you want.

Or, find an ea or script on codebase. I think that this is how the majority of us do it.
Very strange that you simply can't set MT5 to have automatic sounds for the ST and TP being triggered. Setting the alerts manually with each trade seems very labour intensive. Anyone know of an EA or script that automates the job effectively? 
 
Guy Hobbs #: Very strange that you simply can't set MT5 to have automatic sounds
Very strange that you can't write the very few lines of code to make that indicator.
 
Guy Hobbs:
I am new to using MT5, after using Ninjatrader, and I can't believe that a trade's SP or TP can be reached and the trade ends and there is no alert noise to inform me. To me this is a basic requirement for a platform and I can't believe it is not on MT5. I can't find a solution. Do MT5 traders simply work in silence? Or am I missing something? I believe I saw an advert for a file you can use for Mt4 but I can find nothing for MT5. It is such a simple thing - am I the only person who wants such an alert ?  

Try this in the OnTick function



   // Check if any positions are open
   int total_positions = PositionsTotal();
   if (total_positions > 0)
     {
      // Loop through all positions
      for (int i = 0; i < total_positions; i++)
        {
         // Get the ticket number of the position
         ulong ticket = PositionGetTicket(i);

         // Check if the position is active
         if (PositionSelect(ticket))
           {
            // Get the stop loss and take profit levels of the position
            double stop_loss = PositionGetDouble(POSITION_SL);
            double take_profit = PositionGetDouble(POSITION_TP);

            // Get the current market price
            double current_price = SymbolInfoDouble(_Symbol, SYMBOL_BID);

            // Check if the stop loss or take profit level is reached
            if (current_price <= stop_loss || current_price >= take_profit)
              {
               // Send a notification
               string message;
               if (current_price <= stop_loss)
                  message = "Stop Loss Reached for Position " + IntegerToString(ticket);
               else
                  message = "Take Profit Reached for Position " + IntegerToString(ticket);

               SendNotification(message);
              }
           }
        }
     }
  }
 
Nardus Van Staden #:

Try this in the OnTick function


Positions refer to open trades running. So if a trade has TPed or SLed it won't show up in Positions list for you to iterate.

I think best solution is handling OnTradeTransaction event.