A trailing stop sounds simple, but many trailing EAs cause trouble: they send a new stop on every tick (the broker answers "too many requests" or switches off automated trading for the account), they are refused with "invalid stops" because they ignore the stop level of the broker, they place the stop of a sell position inside the spread, or they forget what they were doing after a restart. This EA is written to avoid all of that.
Trailing methods (one at a time)
All distances (distance, buffer, start, step, break-even) are in points or in multiples of ATR, chosen with one input. With ATR multiples the same settings fit EURUSD, gold and indices.
Break-even that is really break-even
When the profit reaches the trigger (default 1 x ATR), the stop is moved to the entry plus a small lock. With "Add commission and swap" on, the EA reads the commission of the entry deal from the history (counted twice, for the entry and the exit) and the swap of the position, and moves the stop further by the price distance that pays them back. A stop at the entry price alone still closes the trade at a loss on a commission account.
Rules that protect your account
Which positions
Manual trades only (magic number 0), one magic number, or all positions; the chart symbol only or all symbols (positions of other symbols are checked once per second by a timer). Works on hedging and netting accounts. It keeps no state of its own: everything is read from the positions, the history and the bars, so a restart of the terminal or a change of the chart changes nothing.
Panel and log
A small panel shows the method, the number of positions managed, the changes of the day and the last action. Every change is written to the Experts log, for example "#123 buy EURUSD SL 1.08000 -> 1.08120 (ATR distance)", and so is every refusal with its return code.
Strategy Tester
In the Strategy Tester only (never on a live or demo chart) the EA opens small demo trades every 10 bars (minimum lot, in the direction of a 50-bar slope), so the trailing can be seen and tested. Switch it off with the last input.
Inputs: positions to manage, magic number, all symbols, method, timeframe, units, distance, buffer, start, step, ATR period, Chandelier period and multiple, swing strength and lookback, SAR step and maximum, MA period and method, break-even on/off, trigger, lock, costs, seconds between changes, daily limit, spread guard, extra points, panel, tester demo trades.
How it was tested
The EA manages stops only. It does not decide entries and cannot make a losing strategy profitable.
EventTracer
An Expert Advisor for MetaTrader 5 that prints one line each time one of its event handlers runs, on a chart, in the Strategy Tester and during an optimization. It never trades.
Volume Profile with Naked POC - day, week, month or year profiles built from M1 bars
Volume profiles per day, week, month or year with POC, value area high and low (classic two-rows method), naked POC lines that stay until price trades through them, and a developing POC. Built from M1 bars. 8 buffers for EAs.
Rollover Cost Table - swap mode from the symbol, triple-swap day from the broker
An MQL5 indicator that draws a table on the chart with one row per open position and shows what one more night of holding it costs, in the deposit currency where the symbol's swap mode allows it. The swap mode and the two rates come from the symbol's own specification, and so does the triple-swap weekday; no rate is typed into the code. Where the symbol charges in points, a horizon column turns that night into the number of normal nights needed to repay one round turn, and a figure the terminal cannot supply is a dash with a reason, never a zero.
MACD Signals
Indicator edition for new platform.