UT Bot Alerts with Signal Stats MT5
- Индикаторы
- Thanh Trung Tran
- Версия: 1.0
A line-by-line MQL5 port of "UT Bot Alerts" by QuantNomad (Pine v4, 2020). The idea is by HPotter and the first version by Yo_adriiiiaan. The original is published as open source on TradingView. All credit goes to those authors.
Also available for MetaTrader 4 (free): https://www.mql5.com/en/market/product/203726
Same logic as the original:
- ATR is atr(c) = Wilder RMA seeded with an SMA. The built-in iATR is not used.
- Trailing stop follows the original nested iff / nz recursion: it ratchets up while price stays above it, ratchets down while price stays below it, and resets to price minus or plus Key Value x ATR when price crosses it.
- Buy = source above the stop and crossing it upward. Sell = the opposite.
- Bar colors: green above the stop, red below it.
- Optional Heikin Ashi source (HA close = OHLC/4).
Inputs (original defaults): Key Value 1, ATR Period 10, Heikin Ashi off.
Made for MetaTrader 5:
- No repainting. A Buy or Sell arrow is drawn when its bar closes and never moves or disappears afterwards. Tested bar by bar on 619,687 one-minute gold bars plus H1, M15, H4 and D1 charts: every value seen when a bar closed equals the final value.
- Alerts on a new signal: popup, sound only, push notification to the MetaTrader 5 mobile app, or e-mail. Once per signal, on the closed bar.
- Trailing-stop line (the original only colors bars) and native MetaTrader 5 colored candles.
- Signal statistics panel. It buys at the bar after a Buy, sells after a Sell, and closes and reverses at the opposite signal. It shows the trades and win rate, the net result in money at your lot size after spread and commission, profit factor, average win and loss, longest losing streak, maximum drawdown, the open trade and the cost per trade. Click its header to fold it to one line; put it in any corner. Its colors follow your chart, dark or light.
- Daily session filter for the statistics, in your own time zone (overnight windows allowed), with session shading and an optional close at session end. Off by default.
- Trade marks on the chart: hover a mark for prices, exit reason and result.
- Works on any symbol and timeframe.
For EA developers (iCustom): buffers 2 = Buy (price of the signal bar), 3 = Sell, 9 = trailing stop, 10 = ATR; EMPTY_VALUE means no value. Simplest call with the default inputs: iCustom(_Symbol, _Period, "Market\\UT Bot Alerts with Signal Stats MT5") . If you pass inputs, each input group heading counts as one parameter (pass an empty string for it). Signals on the closed bar (shift 1) are final.
The panel describes past signals so you can judge them yourself. Please check the cost line: on 1-5 minute charts the spread and commission per trade are large compared with the average move between two signals. It is not a backtest and not a promise of results.
Source code and license: free and open source under the Mozilla Public License 2.0 (MPL-2.0), the same as the original. The complete MQL5 source code is free: ask the author by private message on MQL5 and you will receive it at no cost. This offer stays open for at least three years.
This is a visual tool. It does not place trades and does not predict prices. Test any rule built on it before you trade with it.
More from the author (MetaTrader 5):
- Range Filter Buy Sell with Signal Stats MT5 (free): https://www.mql5.com/en/market/product/209459
- Chandelier Exit with Signal Stats MT5 (free): https://www.mql5.com/en/market/product/209460
- Adaptive SuperTrend KMeans MT5 (free): https://www.mql5.com/en/market/product/209466
- Tester vs Live Trade Matcher MT5 (free): https://www.mql5.com/en/market/product/209467
- GoldSwing T24 MT5 - trend trading with short holding times: https://www.mql5.com/en/market/product/209324
- Gold Momentum Breakout MT5 - momentum, long and short: https://www.mql5.com/en/market/product/209325
- GoldIBH MT5 - three gold strategies in one EA: https://www.mql5.com/en/market/product/209326
- Gold Entry MT5 - two trend systems in one EA: https://www.mql5.com/en/market/product/209327
