OPEN-SOURCE SCRIPT
Median Point of Control

Median Point of Control calculates and displays the median OHLC4 price for customizable time periods, along with percentage-based upper and lower bands. It provides a statistical reference framework for identifying potential support, resistance, and mean-reversion zones.
What It Does
This indicator computes the median of all OHLC4 values within a defined period and plots three horizontal levels:
The current period's levels update dynamically as new bars form. Completed periods are preserved as historical reference lines.
Why Median Instead of Average?
The median is the "middle" value when all prices are sorted. Unlike the mean (average), the median is resistant to outliers — a single extreme wick or price spike won't distort the level. This makes it more representative of typical price action during the period.
Two Calculation Modes
Settings
How To Use
Important Notes
What It Does
This indicator computes the median of all OHLC4 values within a defined period and plots three horizontal levels:
- Median Line — The statistical middle price of the period
- Upper Band — Median + user-defined percentage
- Lower Band — Median - user-defined percentage
The current period's levels update dynamically as new bars form. Completed periods are preserved as historical reference lines.
Why Median Instead of Average?
The median is the "middle" value when all prices are sorted. Unlike the mean (average), the median is resistant to outliers — a single extreme wick or price spike won't distort the level. This makes it more representative of typical price action during the period.
Two Calculation Modes
- Timeframe Mode Define periods using standard timeframes: 4H, Daily, Weekly, Monthly, etc. The indicator automatically detects when each period begins and ends.
- Bars Mode Define periods by a fixed number of bars (e.g., every 50 bars, every 100 bars). Useful for non-time-based analysis or custom period lengths that don't align with standard timeframes.
Settings
- Calculation Mode: Choose between Timeframe or Bars
- Timeframe: Period length when using Timeframe mode
- Bars: Number of bars per period when using Bars mode
- Band Distance (%): Percentage offset for upper/lower bands from median
- Line Colors: Customize colors for median, upper, and lower bands
- Line Width: Thickness of the plotted lines
- Historical Transparency: Opacity of completed period lines
- Max Historical Periods: Number of past periods to display
How To Use
- Identify the range: The upper and lower bands create a price envelope based on the period's median. When price approaches these levels, watch for reactions.
- Mean reversion reference: The median line represents the "fair value" of the period. Price tends to oscillate around this level.
- Breakout detection: If price breaks and holds beyond a band, it may signal trend continuation rather than reversion.
- Multi-timeframe analysis: Use Daily median on intraday charts to see where price stands relative to the day's statistical center.
Important Notes
- This indicator does not predict price direction. It provides statistical reference levels only.
- The current period's median updates with each new bar — this is expected behavior, not repainting.
- Historical period lines are fixed once their period closes.
- For best results, use on liquid instruments (stocks, forex majors, major crypto pairs).
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.