MicroTrend
- Experts
- Versione: 1.10
- Attivazioni: 5
### MicroPulse EA
**A disciplined trend-following system with a stop loss on every trade.**
MicroPulse EA trades one instrument at a time and only in the direction of an established
trend. It waits for a confirmed EMA crossover on closed bars, checks that the trend has real
strength behind it, and then enters with a volatility-scaled stop loss and take profit. There
are no grids, no martingale, no averaging down and no hidden recovery logic.
---
### How it works
**1. Signal — closed bars only**
A fast EMA crossing a slow EMA on the last *closed* bar. Nothing is evaluated on the forming
bar, so the signal cannot repaint.
**2. Confirmation — trend strength and direction**
The ADX must be above a minimum level, and the +DI / -DI pair must agree with the direction of
the crossover. A rising ADX alone is not enough: without directional agreement it can belong to
the opposite side.
**3. Optional higher-timeframe filter**
An EMA on a higher timeframe (H4 by default) can be required to point the same way as the
signal. This removes counter-trend entries during larger corrections. Strongly recommended on
gold.
**4. Optional volatility guard**
Entries are skipped when ATR is far above its own average — i.e. during news spikes and
disorderly markets where stops get jumped.
**5. Stops — always set, always broker-legal**
Stop loss and take profit are ATR multiples, normalised to the symbol tick size and widened to
the broker's minimum stop distance and freeze level. The EA never sends an order without a
stop loss.
**6. Management**
An ATR trailing stop starts only after a configurable amount of profit, so early noise does not
cut a trade short. Optional break-even (including the real round-trip cost) and optional
time-based exit.
**7. Risk controls**
- One position at a time (configurable)
- Fixed lot size, validated against the symbol's min / max / step
- Free-margin check — the trade is skipped rather than silently shrunk
- Optional maximum risk per trade as a percentage of balance
- Optional daily loss limit in account currency
- Optional cooldown after a losing trade
- Session-hour and spread filters
- Magic-number filtering — the EA never touches positions it did not open
---
### Why a fixed lot instead of a risk percentage
On a small account a risk percentage often rounds to a volume below the broker minimum, and the
EA would simply never trade. MicroPulse EA uses an explicit lot size, validates it against the
symbol, and logs clearly if the broker minimum is higher than requested. You always know exactly
what size was traded.
---
### Backtest results
All figures below are **backtest results**, not live trading results. They were produced in the
MetaTrader 5 Strategy Tester with the settings listed. Past performance does not indicate future
results.
**XAUUSDm, H1 — recommended configuration**
| | |
|---|---|
| Period | 2022.01.01 – 2026.11.15 |
| Model | Every tick based on 1-minute OHLC |
| Deposit / leverage | 200 USD / 1:500 |
| Fixed lot | 0.01 |
| Total trades | 129 |
| Winning / losing | 96 / 33 (74.4%) |
| Profit factor | 2.29 |
| Net profit | +924.80 USD |
| Max balance drawdown | 18.6% |
| Sharpe ratio | 3.29 |
| Recovery factor | 4.17 |
| Max consecutive losses | 3 |
**Out-of-sample check, XAUUSDm, H1 — 2019.01.01 – 2022.01.01**
Profit factor 1.74, 102 trades, 65 winners / 37 losers. The edge was present in a period that was
not used for tuning.
**EURUSDm, H1 — 2022.01.01 – 2026.11.15**
Profit factor 1.15, 109 trades, 71 winners / 38 losers, max balance drawdown 27.1%.
The FX edge is thinner and more period-dependent than the gold edge. Test on your own broker
before using it on FX.
---
### Recommended settings
**Gold (XAUUSDm, H1)**
```
InpUseHtfFilter = true
InpHtfEma = 50
InpMaxAtrRatio = 2.0
InpTpAtrMult = 4.5
InpTrailStartAtr = 2.0
InpTrailAtrMult = 2.0
```
**FX majors (EURUSDm / GBPUSDm, H1)**
```
InpUseHtfFilter = false
InpMaxAtrRatio = 0.0
InpTpAtrMult = 4.5
InpTrailStartAtr = 2.0
InpTrailAtrMult = 2.0
```
Everything else can stay at its default.
---
### Inputs
| Group | Input | Default | Meaning |
|---|---|---|---|
| Entry | `InpSignalTf` | current | Signal timeframe |
| | `InpFastEma` / `InpSlowEma` | 45 / 100 | EMA periods |
| | `InpAtrPeriod` / `InpAdxPeriod` | 14 / 14 | ATR and ADX periods |
| | `InpAdxMin` | 25.0 | Minimum ADX to trade |
| | `InpUseAdxDi` | true | Require +DI/-DI agreement |
| | `InpAdxSlopeMin` / `InpAdxSlopeBars` | 0 / 3 | Require ADX to be rising (0 = off) |
| Trend filter | `InpUseHtfFilter` | false | Higher-timeframe trend filter |
| | `InpHtfTf` / `InpHtfEma` | H4 / 50 | Filter timeframe and EMA |
| | `InpMaxChaseAtr` | 0.0 | Max distance from fast EMA in ATR (0 = off) |
| Size | `InpLot` | 0.01 | Fixed lot size |
| Stops | `InpSlAtrMult` | 3.0 | Stop loss in ATR |
| | `InpTpAtrMult` | 4.5 | Take profit in ATR |
| | `InpUseTrailing` | true | ATR trailing stop |
| | `InpTrailStartAtr` | 2.0 | Start trailing after this much profit |
| | `InpTrailAtrMult` | 2.0 | Trail distance in ATR |
| | `InpUseBreakEven` / `InpBreakEvenAtr` | false / 3.0 | Break-even plus costs |
| | `InpExitOnReverse` | false | Close when the signal flips |
| | `InpUseTimeExit` / `InpMaxBarsInTrade` | false / 120 | Time-based exit |
| Filters | `InpMaxSpreadPoints` | 0 | Spread cap in points (0 = off) |
| | `InpMaxSpreadAtr` | 0.25 | Spread cap as a fraction of ATR |
| | `InpStartHour` / `InpEndHour` | 0 / 24 | Trading session (server time) |
| | `InpMaxPositions` | 1 | Max simultaneous positions |
| | `InpMaxDailyLossMoney` | 0.0 | Daily loss limit (0 = off) |
| | `InpCooldownBars` | 0 | Pause after a loss (0 = off) |
| | `InpMaxRiskPercent` | 0.0 | Max risk per trade in % of balance (0 = off) |
| | `InpMaxAtrRatio` / `InpAtrAvgBars` | 0.0 / 100 | Volatility guard (0 = off) |
| Execution | `InpEnableTrading` | true | false = analysis only |
| | `InpMagic` | 772001 | Magic number |
| | `InpSlippage` | 20 | Deviation in points |
| | `InpRetrySeconds` | 10 | Re-check inside a bar |
---
### Requirements
- MetaTrader 5, build 3000 or newer
- Hedging or netting account (one position at a time, so both work)
- Any broker; the EA reads min/max/step, stops level, freeze level and tick size from the symbol
- Recommended timeframe: H1
- Recommended minimum deposit: 200 USD with 0.01 lots on gold, or 100 USD on FX majors
- VPS recommended for continuous operation
---
### What this EA does not do
- It does not use a grid, martingale, averaging or any recovery multiplier.
- It does not open trades without a stop loss.
- It does not hide trades, mask losses or modify account history.
- It does not promise a profit. Trend-following systems lose in ranging markets, and losing
streaks of several trades in a row are normal and expected.
---
### Risk warning
Trading leveraged instruments carries a high level of risk and can result in the loss of all
invested capital. The backtest results shown above were produced on historical data with a
specific broker's price feed and do not guarantee similar results in the future. Always test on
a demo account with your own broker and your own settings before trading real money, and never
risk money you cannot afford to lose.
