Trend Master MT5
- Experts
- Versão: 1.2
- Atualizado: 27 junho 2026
- Ativações: 20
# Trend Master EA – MA Crossover with Scoring & Adaptive Risk
TrendMaster EA is an advanced, multi‑pair trend‑following Expert Advisor for MetaTrader 5, built on a proven Moving Average crossover strategy enhanced with a sophisticated scoring system, dynamic risk management, and comprehensive protection mechanisms. Unlike simple crossover systems, TrendMaster evaluates multiple confluences – candle patterns, support/resistance proximity, RSI, ADX, and volume surges – to filter only high‑probability entries. Its adaptive threshold adjusts to recent win/loss performance, making the system responsive to changing market conditions.
The EA supports simultaneous trading on up to 30 symbols, each with its own magic number and indicator handles. It employs ATR‑based dynamic stops, trailing stops, breakeven, and partial close to protect profits and manage risk. Daily limits, drawdown circuit breakers, and consecutive loss limits ensure capital preservation. With robust error handling, margin checks, and stealth SL/TP options, TrendMaster is designed for both novice and experienced traders who seek a disciplined, rules‑based trend‑following approach.
---
## Core Features
| Feature | Description |
|---------|-------------|
| **MA Crossover** | Uses Fast and Slow Moving Averages (SMA/EMA/etc.) on any timeframe to generate primary buy/sell signals. |
| **Scoring System** | Confirms entries with candle body strength, support/resistance proximity, RSI, ADX, and volume surge – each adds to a total score. |
| **Adaptive Threshold** | Dynamically lowers (or raises) the required score based on recent win streak to adapt to market conditions. |
| **Multi‑Pair Trading** | Automatically trades all MarketWatch symbols or a custom list, with separate indicators and magic numbers per pair. |
| **Dynamic Risk Management** | Supports fixed lot, risk‑percent‑of‑equity, static or dynamic compounding, and martingale (optional). |
| **ATR‑Based SL/TP** | Stop‑loss and take‑profit can be dynamically sized using ATR multipliers, adjusting to volatility. |
| **Trailing Stop** | Static pips or ATR‑dynamic trailing; moves SL to lock in profits as the trade moves in your favour. |
| **Breakeven + Lock** | Moves SL to breakeven (plus a small buffer) once a configurable profit level is reached. |
| **Partial Close** | Closes a percentage of the position when a target profit is hit, locking in partial gains while letting the remainder run. |
| **Stealth SL/TP** | Option to hide stop‑loss and take‑profit from the broker (simulated internally) to avoid hunting. |
| **Daily Protections** | Daily profit target, daily loss limit, maximum trades per day, and consecutive loss stop. |
| **Drawdown Circuit Breaker** | Halts trading if equity drawdown exceeds a user‑defined percentage from peak. |
| **Floating Target** | Closes all positions when unrealised profit reaches a target amount. |
| **Time Filter** | Restricts trading to specific sessions (London, New York, Asia) with custom hours. |
| **Min Candle Size Filter** | Rejects entries if the previous candle’s body is too small, avoiding low‑volatility moves. |
| **Notifications** | Push notifications, Telegram, and email alerts for trades, daily limits, and circuit breaker events. |
---
## 1. MA Crossover Logic
The core entry signal is generated by the crossover of a **Fast MA** and a **Slow MA** on the selected timeframe. A **Buy** signal occurs when the Fast MA crosses **above** the Slow MA; a **Sell** signal when it crosses **below**. The EA uses the last closed bar (bar 1) for the crossover to avoid repainting.
- **Fast MA Period** (default 14)
- **Slow MA Period** (default 50)
- **Method**: SMA, EMA, SMMA, LWMA (default SMA)
- **Applied Price**: Close, Open, High, Low, etc. (default Close)
---
## 2. Scoring System
To reduce false signals, the EA combines multiple confluences into a **score**. Each condition adds a configurable number of points. If the total score meets or exceeds the **threshold** (base or adaptive), the trade is executed.
| Condition | Description | Default Score |
|-----------|-------------|---------------|
| **MA Crossover** | Base score for any crossover (always applied). | 40 |
| **Candle Confirmation** | Candle body > 50% of the range in the direction of the signal. | 15 |
| **Support/Resistance** | Price is near a recent 20‑bar high or low (within 10 pips). | 15 |
| **RSI Scoring** | RSI is between 30 and 70 (neutral zone). | 10 |
| **ADX Scoring** | ADX ≥ minimum level (trend strength filter). | 10 |
| **Volume Surge** | Tick volume > 1.5× average of the last 20 bars. | 10 |
**Adaptive Threshold** – When enabled, the required threshold is adjusted based on recent wins:
- After each winning trade, the threshold increases (making entries more selective).
- The effect is cumulative, but bounded by a minimum threshold.
This helps to lock in gains after profitable streaks and reduce overtrading.
---
## 3. Risk & Money Management
The EA offers flexible position sizing:
- **Fixed Lot** – Uses `InpLotSize` directly.
- **Risk % of Equity** – Calculates lot size so that the potential loss (based on SL distance) does not exceed a percentage of current equity.
- **Auto‑Compounding** – Static or dynamic compounding based on a base balance and lot per base.
- **Martingale** – Increases lot size after consecutive losses (up to a max step).
- **DD Risk Reduction** – Automatically reduces lot size by 50% if equity drawdown exceeds a specified percentage.
All lot sizes are normalised to broker‑allowed minimum/maximum and step size. The EA also performs a **margin check** before placing any order – if free margin is insufficient, the lot is reduced until margin requirements are met, preventing “No money” errors.
---
## 4. Stop‑Loss, Take‑Profit & Trailing
### SL/TP Calculation
- **Static Pips** – User‑defined SL and TP distances (in pips).
- **Dynamic (ATR)** – SL = `ATR × SL_Multiplier`, TP = `ATR × TP_Multiplier`.
- **Fallback** – If both are zero, a minimum SL of 10 points and TP of 20 points is applied to ensure valid stops.
### Stealth Mode
When enabled, SL/TP are **not** sent to the broker. Instead, the EA simulates them by monitoring price and closing the position manually when the respective level is hit. This prevents the broker from seeing your stops.
### Trailing Stop
- **Static** – Activates after a profit of `TrailingPips` and moves SL by `TrailingStep` pips.
- **Dynamic (ATR)** – Activation and step distances are based on ATR multipliers, adapting to volatility.
### Breakeven
Once profit reaches `BreakevenTrigger` pips, SL is moved to the entry price plus a small lock (`BreakevenPlus`). Optionally, the trigger can be ATR‑based.
### Partial Close
When profit reaches `PartialTrigger` pips, a percentage (`PartialPercent`) of the position is closed. The remainder then has SL moved to breakeven, protecting the locked‑in profit.
---
## 5. Multi‑Pair Support
TrendMaster can trade multiple symbols simultaneously from a single chart. It automatically detects all MarketWatch symbols or accepts a custom comma‑separated list (e.g., `EURUSD,GBPUSD,XAUUSD`). Each pair receives its own:
- Indicator handles (MA, ADX, RSI, ATR)
- Magic number (base + offset)
- Pip size calculation (handles forex, metals, and indices correctly)
The EA processes each pair independently, respecting the same global risk and protection rules.
---
## 6. Daily & Account Protection
| Protection | Description |
|------------|-------------|
| **Daily Profit Target** | Stops new trades and closes all positions when daily realised profit exceeds target (fixed or % of balance). |
| **Daily Loss Limit** | Closes all positions and halts trading if daily realised loss exceeds `MaxDailyLossPct`. |
| **Max Daily Trades** | Limits the number of trades per day (global across all pairs). |
| **Consecutive Loss Limit** | Pauses trading for a pair after N consecutive losing trades (per magic number). |
| **Circuit Breaker** | If equity drawdown from peak balance exceeds `CircuitBreakerDD`, all positions are closed and trading is stopped. |
| **Floating Target** | Closes all positions when unrealised profit reaches a set amount. |
| **Margin Check** | Prevents orders when free margin is insufficient (auto‑adjusts lot). |
All daily limits are persisted via global variables, so they survive EA restarts.
---
## 7. Filters & Additional Options
- **Time Filter** – Restrict trading to specific sessions (London, New York, Asia) with custom start/end hours.
- **Min Candle Size** – Skip entry if the last closed candle’s body is smaller than `MinCandleSizePips`.
- **ADX/RSI Filters** – Optional hard filters that reject trades if ADX is too low or RSI is overbought/oversold (applied in addition to scoring).
---
## 8. Notifications
The EA can send alerts via:
- **Push Notifications** – to your mobile MT5 app.
- **Telegram** – requires bot token and chat ID (message JSON is properly escaped).
- **Email** – via MetaTrader’s SMTP settings.
Alerts are sent for:
- Trade openings (buy/sell with lot size and price)
- Daily target/loss hits
- Circuit breaker activation
- Stealth exits
- Partial closes
---
## Requirements
| Requirement | Details |
|-------------|---------|
| **Platform** | MetaTrader 5 |
| **Minimum Deposit** | $100 (cent) / $500 (standard) – adjustable via risk settings |
| **Recommended TF** | H1 or H4 for trend following (works on any timeframe) |
| **Supported Pairs** | Forex, metals, indices, crypto (auto‑detects pip size) |
| **Account Type** | Hedge or Netting |
| **Broker** | Any MT5 broker (ECN recommended for tighter spreads) |
---
## Setup Instructions
1. **Attach to Chart** – Place the EA on a single chart (e.g., EURUSD H1). The EA can trade multiple symbols even from one chart.
2. **Configure MA & Scoring**
- Set `InpFastMAPeriod` and `InpSlowMAPeriod`.
- Adjust scoring parameters if desired.
3. **Set Risk & Position Sizing**
- Choose `InpUseRiskPercent` or fixed lot.
- For compounding, enable `InpAutoCompound` and set base values.
4. **Configure SL/TP & Trailing**
- Define static pips or enable `InpUseDynamicSLTP` for ATR‑based stops.
- Enable trailing, breakeven, and partial close as needed.
5. **Set Daily & Drawdown Protections**
- Define daily target/loss percentages, circuit breaker DD, etc.
6. **Multi‑Pair Settings**
- Enable `InpMultiPair` and optionally provide a custom symbol list.
- Set `InpMaxPairs` (default 30) to limit the number of traded symbols.
7. **Notifications** – Fill in Telegram/Email credentials if alerts are desired.
8. **Test on Demo** – Always backtest and forward‑test on a demo account before going live.
---
## Important Notes
- **Single Chart, Multiple Pairs** – The EA can trade many symbols from one chart. For better performance, you may attach it to each symbol’s chart and disable multi‑pair mode.
- **Magic Number** – Each pair gets a unique magic number (`InpMagicNumber + index`). This allows separate management of positions per symbol.
- **Indicator Consistency** – All signals and filters are based on **closed** candles (bar 1) to avoid repainting.
- **Partial Close** – The EA tracks partial closes per ticket to avoid repeated partials on the same position.
- **Stealth Mode** – Simulated SL/TP may be affected by fast market gaps – use with caution.
- **ATR Fallback** – If ATR fails to load, the EA falls back to static pips.
---
## Frequently Asked Questions
**Q: What is the recommended timeframe?**
A: H1 or H4 work well for trend following, but the EA can be used on any timeframe. Lower timeframes may generate more signals but also more false ones.
**Q: Can I use this EA on gold (XAUUSD) or crypto?**
A: Yes. The EA automatically detects the correct pip size (10 points for XAU, etc.) and adjusts calculations accordingly.
**Q: How does adaptive threshold work?**
A: After each winning trade, the required score increases by `InpReductionPerWin` (default +5). This makes the EA more selective during winning streaks, helping to protect profits.
**Q: Will the EA manage multiple positions per pair?**
A: The EA can hold multiple positions per pair if the scoring system generates additional signals while a position is open. However, the entry logic only acts on new bars, so multiple signals may occur over time.
**Q: What happens if the EA is restarted during the day?**
A: Daily limits (trades, profit/loss) are stored in global variables, so they persist across restarts. The EA will continue enforcing the day’s limits.
**Q: How are SL/TP handled with Stealth mode?**
A: The EA monitors price internally and closes the position when the hidden SL/TP level is touched. This prevents the broker from seeing your stops, but may result in slippage during volatile moves.
**Q: Can I use this EA with a Martingale strategy?**
A: Yes – enable `InpMartingale` and set the multiplier and max steps. However, Martingale increases risk significantly and should be used with caution.
**Q: Why does the EA not open trades despite crossover signals?**
A: The score must reach the threshold (base or adaptive). Also check filters (ADX, RSI, time, min candle size) and daily limits. The EA logs the score and filters in the Experts tab.
---
## Disclaimer
Trading foreign exchange, metals, indices, and cryptocurrencies carries a high level of risk and may not be suitable for all investors. You could lose all of your invested capital.
**TrendMaster EA** is an automated trading tool designed to assist in decision‑making; it does **not** guarantee profits. Users are solely responsible for:
- Performing thorough backtesting and forward testing on demo accounts
- Applying sound risk management practices
- Understanding the system’s logic before live deployment
- Avoiding trading with funds they cannot afford to lose
Past performance is not indicative of future results. Settings should be adjusted to prevailing market conditions and your broker’s execution quality. By using this product, you acknowledge and accept these risks.
