THV Trailing Buy Sell Stop Mt5
- Experts
- Trong Khanh Phan
- Versione: 1.28
- Aggiornato: 13 marzo 2026
- Attivazioni: 10
Hi Traders,
This EA handle the TRAILING Buy Stop and/or TRAILING Sell Stop Logic in a very smart way. You can choose only Buy / only Sell or both.
Configurations (default values are shown in brackets):
//
- ATR period: input the ATR period for calculation (14)
- Magic Number: define the magic number
//
- Enable Buy Stop: Allow the EA to place a Buy Stop order
- Lot Buy: volume of Buy Stop order
- Enable Sell Stop: Allow the EA to place a Sell Stop order
- Lot Sell: volume of Sell Stop order
//
- Balance Start: If the account balance is below this value, the EA will use the base lot size.
- Balance Step: For each increment of this value above Balance Start, the lot will be multiplied by the Lot Multiplier.
- Lot Multiplier: Input the value you want the EA to leverage the new lot with the incremental balance
- Lot Max: Max lot allowed after multiplication
//
- Stop distance in ATR or in points: Input the distance in ATR multiplier or in points to place the stop order
//
- Enable OCO Mode:
+ If true, trigger buy stop order will delete sell stop order, or vice versa
+ If false, allow both buy stop and sell stop to remain
//
- Enable initial SL & TP?:
+ True: set SL TP for all open positions (SL TP to be set to each position separately)
+ False: Skip setting the SL & TP
- TP in points: set your desired TP in points. Set = 0 to remove the TP
- SL in points: set your desired SL in points. Set = 0 and set Trailing = false and break-even = false to remove the SL
- Enable virtual SLTP: True = hide SLTP from the broker
//
- Enable trailing stop?: Enable / Disable trailing stop
- Profit to activate trailing (points): The trailing only starts if the minimum profit reaches this value
- Trailing step (points): The min price move that allows the SL to be trailed
//
- Enable break-even (BE)?: Enable / Disable break-even logic (moving SL to BE)
- Profit to activate break-even (points): The min profit to activate moving SL to BE
- Lock profit from BE (points): offset the SL from break-even
//
- Use ATR Filter: = True to filter out low volatility markets. = False to skip.
- Input min ATR to allow trade when Use ATR Filter: Input the min ATR value to allow trades. Ex. 10 means the EA only opens trades if the min ATR of the current time frame is greater than 10
//
- Equity Stop Threshold: If the equity drops to this value, the EA will close all open positions, delete all pending orders (all symbols) and stop trading (equity-based stop loss).
- Equity Target Threshold: If the equity reaches this value, the EA will close all open positions, delete all pending orders (all symbols) and stop trading (equity-based take profit).
*Whenever the equity comes back to the thresholds, the EA would trade again (ex: deposits / withdrawals).
//Trading with hotkeys: You can change the default keys to other Key you prefer (A to Z or main keyboard numeric 0 to 9. Leave blank to disable the relative function).
- Key to open a Buy position (ArrowUp) : Key to open a Buy trade.
- Key to open a Sell position(ArrowDown): Key to open a Sell trade.
//
- Key to close all profitable positions (C): Key to close all profitable positions (both Buy & Sell of the same symbol)
- Key to close all losing positions: (): Key to close all losing positions (both Buy & Sell of the same symbol)
- Key to close all positions: (Z): Key to close all positions (both Buy & Sell of the same symbol)
//
- Key to close all profitable Buy positions (D): Key to close all profitable Buy positions (same symbol)
- Key to close all losing Buy positions (): Key to close all losing Buy positions (same symbol)
- Key to close all Buy positions (A): Key to close all Buy positions (same symbol)
//
- Key to close all profitable Sell positions (E): Key to close all profitable Sell positions (same symbol)
- Key to close all losing Sell positions(): Key to close all losing Sell positions (same symbol)
- Key to close all Sell positions(Q): Key to close all Sell positions (same symbol)
Happy Trading !

