ExcursionLogger
- Utilità
- Versione: 1.0
ExcursionLogger records how far each of your positions actually moved — in your favor (MFE) and against you (MAE) — and writes one CSV row per closed position. It does not trade.
Most traders set stop-loss and take-profit distances by habit. ExcursionLogger lets you set them from your own data: the distribution of adverse excursion your winning trades survived, how much of the favorable move you actually captured, and how many trades never moved at all.
Attach it to one chart on the account. It observes positions opened by any EA or manually, tracks the maximum favorable excursion and maximum adverse excursion while each position is open, and appends the result to a CSV file in MQL5/Files when the position closes.
What is recorded (one row per closed position)
- Open/close time, symbol, magic number, direction, volume, open/close price
- Bars held and realized profit (including swap and commission)
- mfe_price / mae_price — maximum favorable/adverse excursion in price units
- mfe_money / mae_money — the same in account currency
- mfe_bar / mae_bar — how many bars into the trade each extreme occurred
- Snapshots at fixed bar counts (default 6/12/24/48 bars): mfe_at_6, mae_at_6, ... so you can see how quickly trades moved
How to use
1. Attach ExcursionLogger to any one chart on the account (one chart per account is enough — it watches all symbols).
2. Trade as usual with your EA or manually. Optionally set InpTargetMagic to limit logging to one EA (-1 = all, 0 = manual only).
3. After positions close, open ExcursionLogger.csv in MQL5/Files and analyze it in Excel, Python, or any tool you like.
Why measure this?
In the developer's own measurement of 266 closed trades (GOLD, M5, one year), the median adverse excursion was about the same size as the median favorable excursion, and half of the winning trades had first gone roughly $24 against the entry. A stop-loss placed inside that range would have cut the winners, not the losses. Your strategy will have different numbers — ExcursionLogger exists so you can find yours.
Notes
- Observation only. This utility never opens, closes, or modifies positions.
- A state file (ExcursionLogger_state.bin) preserves tracking across terminal restarts.
- Bar counting uses InpBarTF (default M5). Snapshot bar counts are configurable via InpSnapshotBars.
- Support is provided through this product page. Please include your CSV header row and input settings when asking questions.
