Session Median ATR Pro
- Göstergeler
- Gerhard Beyer
- Sürüm: 1.2
- Etkinleştirmeler: 20
What this indicator does
ATRMEDIAN TimeFilter plots three volatility lines in a separate window:
-
ATR (reference) – classic ATR for comparison
-
MedianRange (Median True Range) – median of True Range values, calculated only from bars inside your chosen time window
-
MedianRange_MA – moving average of MedianRange that updates only when a new median value is produced (stable line; no “fake” updates)
Why Median True Range (instead of “just ATR”)?
Classic ATR can be distorted by one-off spikes (news, bad ticks, thin liquidity).
MedianRange uses the median of True Range samples, which significantly reduces the influence of extreme outliers and provides a cleaner “typical volatility” estimate for:
-
risk sizing / volatility targeting
-
SL/TP distances
-
regime filters (quiet vs active market)
-
breakout/mean-reversion thresholds
Liquidity Time Filter (the “high-volume hours only” concept)
You can restrict MedianRange to intraday time windows that usually have higher participation and volume (e.g., London/NY session overlap). This helps you avoid volatility readings polluted by:
-
low-volume chop
-
spread spikes and random wicks
-
illiquid rollover/transition hours
✅ Supports overnight windows too (e.g., 22:00–03:00).
ℹ️ Works intraday only; D1 and higher ignore the filter (by design).
⚠️ Time window is based on broker/server time.
Visual tools (optional)
-
Session start/end markers (vertical lines)
-
Calculation range boxes (shows which bars are used for the median window)
-
Last candle range projection (draws a box showing the selected range type: ATR / MedianRange / MedianRange_MA)
Indicator buffers (for EAs / iCustom)
-
Buffer 0: ATR
-
Buffer 1: MedianRange
-
Buffer 2: MedianRange_MA
Inputs / Parameters (English)
| Input | Type | Default | Meaning |
|---|---|---|---|
| InpSourceTimeframe | ENUM_TIMEFRAMES | PERIOD_CURRENT | Timeframe used for calculations (can differ from chart TF). |
| InpRangePeriod | int | 14 | Period for ATR and MedianRange sample window. |
| InpMedianMaPeriod | int | 10 | Moving average period applied to MedianRange. |
| InpMedianMaType | enum (SMA/EMA/SMMA/LWMA) | SMA | MA type for MedianRange_MA. |
| InpTimeFilterEnabled | bool | true | Enables the intraday time filter for MedianRange. |
| InpFilterStartHour | int | 8 | Filter start hour (server time). |
| InpFilterStartMinute | int | 0 | Filter start minute. |
| InpFilterEndHour | int | 20 | Filter end hour (server time). |
| InpFilterEndMinute | int | 0 | Filter end minute. |
| InpCalculateOnlyOnNewBar | bool | true | Recalculate only when a new source bar forms (efficient + stable). |
| InpHoldLastValidValue | bool | true | If no valid value, carry forward last valid value (smoother series). |
| InpDisplayLastValidInsideFilter | bool | false | Controls whether carried values are displayed inside the filter window. |
| InpShowAtrLine | bool | true | Show/hide ATR line. |
| InpShowMedianLine | bool | true | Show/hide MedianRange line. |
| InpShowMedianMaLine | bool | true | Show/hide MedianRange_MA line. |
| InpShowTimeFilterMarkers | bool | false | Draw vertical markers for filter start/end on the main chart. |
| InpMarkerDaysToDraw | int | 5 | How many past days to draw markers for. |
| InpAtrColor | color | DodgerBlue | ATR line color. |
| InpMedianColor | color | DarkOrange | MedianRange line color. |
| InpMedianMaColor | color | LimeGreen | MedianRange_MA line color. |
| InpAtrLineStyle | ENUM_LINE_STYLE | DASH | ATR line style. |
| InpMedianLineStyle | ENUM_LINE_STYLE | SOLID | MedianRange line style. |
| InpMedianMaLineStyle | ENUM_LINE_STYLE | SOLID | MedianRange_MA line style. |
| InpAtrLineWidth | int (1..5) | 2 | ATR line width. |
| InpMedianLineWidth | int (1..5) | 2 | MedianRange line width. |
| InpMedianMaLineWidth | int (1..5) | 2 | MedianRange_MA line width. |
| InpMarkerStartColor | color | Teal | Start marker color. |
| InpMarkerEndColor | color | IndianRed | End marker color. |
| InpMarkerLineStyle | ENUM_LINE_STYLE | DOT | Marker line style. |
| InpMarkerLineWidth | int (1..5) | 1 | Marker line width. |
| InpShowCalcRangeBoxes | bool | false | Draw boxes for bars used in the median window. |
| InpCalcRangeBoxColor | color | Gold | Calculation box color. |
| InpCalcRangeBoxLineStyle | ENUM_LINE_STYLE | DOT | Calculation box style. |
| InpCalcRangeBoxLineWidth | int (1..5) | 1 | Calculation box width. |
| InpLastCandleRangeSource | enum (None/ATR/MedianRange/MedianRange_MA) | None | Which range to project on the latest candle. |
| InpLastCandleRangeBoxColor | color | Magenta | Color for the last-candle range box. |
Practical setup suggestions (quick)
-
FX / indices (liquid hours): enable filter, pick London/NY overlap, keep RangePeriod 14.
-
Crypto (24/7): either disable filter or define your own “active hours” window.
-
Swing trading (D1+): filter is ignored; use MedianRange as robust daily volatility.
Risk note (recommended for Market)
This product is an analytical tool (indicator). It does not provide financial advice and does not guarantee profits. Use proper risk management.
