Range Filter Buy Sell with Signal Stats MT5
- インディケータ
- Thanh Trung Tran
- バージョン: 1.0
A line-by-line MQL5 port of "Range Filter Buy and Sell 5min": the original Range Filter by DonovanWall, the simplified version by guikroth and the Pine v5 update by tvenn. It 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/203727
Same logic as the original:
- Smoothed range = EMA(EMA(|close - close[1]|, period), 2 x period - 1) x multiplier. Each EMA is seeded with an SMA, the same as ta.ema .
- Range filter: the line stays put until price moves beyond it by more than the smoothed range, then follows at that distance.
- Upward / downward counters, then long and short conditions. A Buy or Sell is printed once per change of side, using the original CondIni logic.
- High / low target bands at filter +/- range. Bar colors as in the original.
Inputs (original defaults): Sampling Period 100, Range Multiplier 3.0.
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.
- Automatic colors: the original white "rising" color turns near-black on a light chart, so the line and bars stay visible on any chart theme.
- 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 4 = Buy (price of the signal bar), 5 = Sell, 11 = filter value, 12 = smoothed range; EMPTY_VALUE means no value. Simplest call with the default inputs: iCustom(_Symbol, _Period, "Market\\Range Filter Buy Sell 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. 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 full MQL5 source code is published in the MQL5 Code Base by the same author.
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):
- UT Bot Alerts with Signal Stats MT5 (free): https://www.mql5.com/en/market/product/209458
- 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
