TrendFollow EA
- Experts
- Igor Widiger
- Versione: 1.30
- Attivazioni: 10
TrendFollowEA v1.30 – Structure Trend Follower with Supertrend Trailing & Risk Limits (Day/Week/Month)
TrendFollowEA is a rules-based trend-following expert advisor for MetaTrader 5 that derives breakout entries from a clearly defined pivot structure and manages positions using a Supertrend-based trailing stop. The EA combines clean entry logic, flexible execution (pending or market-on-touch), optional trend/momentum filters (MA & MACD), and professional risk management including maximum loss limits in % per day/week/month (with pause until reset).
Important note: Trading involves risk. There is no guarantee of profit. Please always test first in the Strategy Tester and on a demo account.
1) Strategy / Entry Logic (Structure → Breakout)
The EA searches for a 4-point structure on the selected signal timeframe:
Long Setup
Low1 → High1 → Low2 → High2 with:
- Low2 > Low1
- High2 > High1
Entry:
- BuyStop at High2 + Offset (or virtually "Market-on-Touch")
Short Setup
High1 → Low1 → High2 → Low2 with:
- High2 < High1
- Low2 < Low1
Entry:
- SellStop at Low2 − Offset (or virtually "Market-on-Touch")
If both long and short positions are valid simultaneously, the newer setup is preferred.
2) Entry Modes
A) Pending (BuyStop/SellStop)
- Real Stop Orders (BuyStop / SellStop)
- Optional Expiry after N Bars
- Optional: Cancel on Structure Break (Close below Low2 / above High2)
B) Market-on-Touch (Virtual Setup)
- EA "arms" a virtual setup (Entry/SL)
- As soon as the price touches the entry level: Market execution
- Optional: "Replace on New Signal" (new setup overwrites old one)
3) Stop-Loss & Trade Management
Initial Stop-Loss (SL)
- Pending Mode: SL based on Pivot 1 or Pivot 2 (Low 1/Low 2 or High 1/High 2) + Offset
- Market-on-Touch: SL from Candle Low/High (Shift) + Offset (Fallback: Pivot-based)
Trailing Stop via Supertrend
- Supertrend Price (closed bar) ± Trailing Buffer (Points)
- SL is only trailed (never loosened)
4) Optional Filters (can be disabled)
MA Trend Filter (optional)
- Long only if Close(1) > MA (+ Buffer)
- Short only if Close(1) < MA (− Buffer)
- Timeframe/Period/Method/Price freely configurable (e.g., EMA200)
MACD Filter (optional)
- Long only if MACD Main > Signal
- Short only if MACD Main < Signal
- Optional: additional Zero-Line Filter (Main > 0 or < 0)
5) Sessions / Trading Hours
- Asia / London / US trading hours can be activated separately
- Session logic: Asia OR London OR US
- Optional:
- Delete pending orders at the end of the session
- Close positions at the end of the session
6) Money Management (Risk / Volume)
- Fixed Lots
- Risk Money (e.g., €50 per trade)
- Risk % (Balance or Equity)
Volume is properly normalized based on entry/stop distance and symbol limits (min/step/max).
7) Risk Limits (Max Loss % per day/week/month)
Professional risk management to stop new entries:
- Max Loss Day %
- Max Loss Week % (starting Monday at 00:00)
- Max Loss Month % (starting the 1st of the month at 00:00)
Options:
- ACCOUNT Scope: Equity/Balance Delta from the start of the period (ideally "prop" style)
- MAGIC Scope: only trades of this EA (closed + optional floating)
When the limit is reached:
- EA enters RISK PAUSE (optional "Lock to Reset")
- Optional: Delete pending trades / reset virtual setup / close positions
- Panel displays warning + cause (DAY/WEEK/MONTH)
- Optional: Persistent pause state (via terminal global variables) – the lock remains even after a restart
8) UI Panel (Dashboard)
- Compact or detailed (Debug)
- Color coding:
- Gain: green
- Loss: red
- Risk Pause/Warnings: orange
- Display includes:
- Day/Week/Month PnL
- Session status
- Mode (Pending/Touch)
- Setup status including Entry/SL/Volume
- Supertrend + Trail Buffer
- Risk Pause Reason
9) Installation / Requirements
- MetaTrader 5 (Windows/VPS), Algo Trading enabled
- Drag the Expert Advisor (EA) onto the chart (symbol of your choice)
- Set parameters (timeframe, risk, sessions, filters)
- Recommendation: first use the Strategy Tester (real ticks) → Demo → Live
Recommended Start (Trend Following)
- Signal Timeframe: e.g., M15/M30/H1 (depending on the market)
- MA Filter: EMA 200 (optional)
- MACD: 12/26/9 (optional)
- Risk Limits: Start conservatively (e.g., Day 1–2%, Week 3–5%, Month 6–10%)
Disclaimer
This product does not constitute financial advice. Past performance is not indicative of future results. Please use appropriate risk management.

