Auto TPSL MT5
- Utilitaires
- Sathit Sukhirun
- Version: 1.4
- Mise à jour: 29 novembre 2025
Buy 1 Get 1 Free
Key Benefits of Using Auto TPSL (Take Profit / Stop Loss)
"Auto TPSL" is an Expert Advisor (EA) designed to automatically manage Take Profit (TP) and Stop Loss (SL) for your orders in MetaTrader. This offers significant advantages for traders:
-
Saves Time and Reduces Workload: You don't need to manually set TP/SL for every order. The EA will handle it automatically as soon as an order is opened.
-
Consistency in Risk Management: Helps you maintain discipline in setting profit targets and loss limits according to your trading plan, preventing emotional decision-making.
-
Reduces Drawdown Risk: SL helps limit losses to an acceptable level, preventing significant damage to your portfolio from unexpected price movements.
-
Secures Profits: TP ensures you lock in profits when the price reaches your target, without needing to constantly monitor the screen.
-
Trading Flexibility: You can choose between two TP/SL setting modes: Fix Pip (fixed value) or ATR (based on market volatility), which suits a variety of strategies.
-
Supports Manual Trades: If MagicNumber is set to 0 , the EA can manage TP/SL for orders you open manually (if they don't already have SL/TP).
-
Automated Order Management for Other EAs: If you use orders opened by other EAs that lack built-in TP/SL functionality, Auto TPSL can complement them by setting the MagicNumber accordingly.
Explanation of Each Input Parameter
Each Input Parameter plays a crucial role in defining the EA's behavior:
-
SltpMode (SL/TP Mode)
-
Benefit: Used to select the method you want to use for defining Take Profit and Stop Loss.
-
Options:
-
MODE_FIX_PIP : Sets TP/SL as a fixed number of pips that you specify.
-
MODE_ATR : Sets TP/SL based on the Average True Range (ATR) value, which adjusts according to market volatility.
-
-
Recommendation: If your strategy requires fixed TP/SL levels, choose MODE_FIX_PIP . If you want your TP/SL to adapt to market conditions, choose MODE_ATR .
-
-
TakeProfitPips (Take Profit (pips) | (Mode: Fix Pip))
-
Benefit: Defines the number of pips you want to gain for the order. When the price reaches this point, the order will close automatically to secure profit.
-
Usage: Only applicable when SltpMode is MODE_FIX_PIP .
-
Recommended Value: A positive integer (e.g., 50 for 50 pips). Set to 0 if you do not wish to set a TP.
-
-
StopLossPips (Stop Loss (pips) | (Mode: Fix Pip))
-
Benefit: Defines the maximum number of pips you are willing to lose. When the price reaches this point, the order will close automatically to limit losses.
-
Usage: Only applicable when SltpMode is MODE_FIX_PIP .
-
Recommended Value: A positive integer (e.g., 20 for 20 pips). Set to 0 if you do not wish to set an SL.
-
-
AtrPeriod (ATR Period | (Mode: ATR))
-
Benefit: Defines the period (number of candlesticks) used to calculate the Average True Range (ATR) value.
-
Usage: Only applicable when SltpMode is MODE_ATR .
-
Recommended Value: Typically 14 or 20, which are standard values for ATR calculation.
-
-
AtrTimeframe (ATR Timeframe (0=Current Chart) | (Mode: ATR))
-
Benefit: Defines the timeframe used for ATR calculation. You can have the EA calculate ATR from the current chart's timeframe or a different one.
-
Usage: Only applicable when SltpMode is MODE_ATR .
-
Options:
-
PERIOD_CURRENT : Uses the same timeframe as the chart the EA is running on.
-
PERIOD_M1 , PERIOD_M5 , ..., PERIOD_MN1 : Selects a specific timeframe.
-
-
Recommendation: Using ATR from a higher timeframe than your actual trading timeframe can sometimes lead to more stable TP/SL levels, as higher timeframe ATR tends to be less volatile.
-
-
AtrSlMultiplier (ATR Stop Loss Multiplier | (Mode: ATR))
-
Benefit: Defines a multiplier for the ATR value to calculate the Stop Loss. A larger multiplier will place the SL further from the open price.
-
Usage: Only applicable when SltpMode is MODE_ATR .
-
Recommended Value: A positive decimal number (e.g., 1.5 means SL = 1.5 * ATR). Set to 0 if you do not wish to set an SL using ATR.
-
-
AtrTpMultiplier (ATR Take Profit Multiplier | (Mode: ATR))
-
Benefit: Defines a multiplier for the ATR value to calculate the Take Profit. A larger multiplier will place the TP further from the open price.
-
Usage: Only applicable when SltpMode is MODE_ATR .
-
Recommended Value: A positive decimal number (e.g., 2.0 means TP = 2.0 * ATR). Set to 0 if you do not wish to set a TP using ATR.
-
-
EnableModify (Enable/Disable EA)
-
Benefit: Acts as an on/off switch for the EA. You can easily enable or disable Auto TPSL without removing it from the chart.
-
Options: true (enabled), false (disabled).
-
-
MagicNumber (Magic Number to filter (0 for manual trades))
-
Benefit: Used to filter which orders the EA will manage TP/SL for.
-
If set to 0 : The EA will manage all manually opened orders that do not yet have TP/SL.
-
If set to any other number (not 0 ): The EA will only manage orders that have a Magic Number matching the value you specify (suitable for orders opened by other EAs).
-
-
Recommendation: Ensure that the Magic Number you set does not conflict with other EAs you might be running. If you want Auto TPSL to manage orders from another specific EA, set MagicNumber to match that EA's Magic Number.
-
