Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

TP SL Tracking - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 2 reads | 0 comments |

The author of the idea - Sergei Efimenko

mq5 code author - Bara Bashkakon

Stop Loss ( Stop Loss ) and Take Profit ( Take Profit ) are initially set if these properties are not set for the position. Trailing is only available for profitable positions.

If only zero value is "true" - this means searching for positions with zero stop loss or take profit. Once you find a location like this:

If the zero-only parameter is "false", the Stop Loss ( Stop Loss ) and Take Profit ( Take Profit ) parameters are disabled.

The EA works on all positions of the current symbol - unique magic numbers are not taken into account.

To see how this all works, uncomment the string :

  ExtStopLoss = InpStopLoss * m_adjusted_point;
  ExtTakeProfit = InpTakeProfit * m_adjusted_point;
  ExtTrailingStop= InpTrailingStop * m_adjusted_point;
  ExtTrailingStep = InpTrailingStep * m_adjusted_point; //m_trade.Buy(2.0);
//m_trade.Sell(1.0);
//--- return ( initialization successful );
  }

And launch the EA in the strategy tester.


Attachment download

📎 tp_sl_trailing.mq5 (21.72 KB)

Source: MQL5 #22001

Verification code Refresh