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).
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.