Range Filter Buy Sell with Signal Stats
- Индикаторы
- Версия: 1.10
A line-by-line port of "Range Filter Buy and Sell 5min":
- original Range Filter by DonovanWall
- simplified version by guikroth
- Pine v5 update by tvenn
It is published as open source on TradingView. All credit goes to those authors.
The logic is exactly the original's:
- Smoothed range = EMA(EMA(|close − close[1]|, period), 2 × period − 1) × 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.
Added for MT4:
- 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:
- trades, win rate, net points / pips / USD after spread + commission
- profit factor, longest losing streak, max drawdown
- the open trade and the cost per trade
- Daily session filter in your own time zone, with session shading and an optional close at session end. It is off by default (the panel counts the whole day); set Use_Session = true and your hours to use it.
- Trade marks with tooltips.
- Alerts on new signals.
Buffers for EAs ( iCustom ): 5 = Buy, 6 = Sell, 11 = filter value.
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 MQL4 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.
