Indicator · Pine Script v6 · Own pane

Normalized Market Monitor

by realanthonyc

Normalized Market Monitor scales the price action of two distinct symbols into a normalized oscillator ranging from -100 to +100 over a chosen lookback period.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code68
Settings3inputs
LicenceMPL-2.0
Last update7 months ago7 Mar 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

68 lines of Pine Script v6 from nmm.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

nmm.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © realanthonyc https://www.tradingview.com/u/realanthonyc

//@version=6
// ----------------------------------------------------------------------
//  Normalized Market Monitor (NMM)
//  On GitHub: https://github.com/realanthonyc/Normalized-Market-Monitor
//  v1.0.0
// ----------------------------------------------------------------------
indicator(title="Normalized Market Monitor", shorttitle="NMM", overlay=false)

// === Main Symbol (e.g. ES futures) ===
sym_main = input.symbol("ES1!", title="Main Symbol", tooltip="Recommended: ES1! or NQ1!")

// === Secondary Symbol (e.g. BTCUSD) ===
sym_sec = input.symbol("BTCUSD", title="Secondary Symbol")

// Lookback period for normalization
length = input.int(14, title="Lookback Length", minval=1)

// === Data for main symbol ===
close_main = request.security(sym_main, timeframe.period, close)
high_main  = request.security(sym_main, timeframe.period, ta.highest(high, length))
low_main   = request.security(sym_main, timeframe.period, ta.lowest(low, length))
norm_main  = (close_main - low_main) / (high_main - low_main) * 200 - 100

// === Data for secondary symbol ===
close_sec = request.security(sym_sec, timeframe.period, close)
high_sec  = request.security(sym_sec, timeframe.period, ta.highest(high, length))
low_sec   = request.security(sym_sec, timeframe.period, ta.lowest(low, length))
norm_sec  = (close_sec - low_sec) / (high_sec - low_sec) * 200 - 100

// === Time range check (adjusted to approximate ET for US stock market sessions) ===
in_time_range(start_hour, start_min, end_hour, end_min) =>
    offset = syminfo.timezone == "America/Chicago" ? 1 : 0
    h_et = hour + offset
    h_et := h_et >= 24 ? h_et - 24 : h_et
    m = minute
    start_time = start_hour * 60 + start_min
    end_time   = end_hour   * 60 + end_min
    current_time = h_et * 60 + m
    if start_time <= end_time
        current_time >= start_time and current_time < end_time
    else
        current_time >= start_time or current_time < end_time

// US stock market sessions in ET (exclude weekends from pre/after)
is_pre   = in_time_range(4, 0, 9, 30) and not (dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday)
is_after = in_time_range(16, 0, 20, 0) and not (dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday)
is_off   = in_time_range(20, 0, 4, 0) or dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday

// Plot lines only when data is available
plot(not na(close_sec) ? norm_sec : na, title="Normalized Secondary", color=color.orange, linewidth=1, style=plot.style_linebr)
plot(not na(close_main) ? norm_main : na, title="Normalized Main", color=color.blue, linewidth=2, style=plot.style_linebr)

// Reference lines
hline(100,  "Upper Bound", color=color.gray, linestyle=hline.style_dashed, editable=false)
hline(0,    "Zero Line",   color=color.gray, linestyle=hline.style_dashed, editable=false)
hline(-100, "Lower Bound", color=color.gray, linestyle=hline.style_dashed, editable=false)

// Add spacings
hline(115,  "Upper Spacing", color=color.rgb(0, 0, 0, 100), editable=false)
hline(-115, "Lower Spacing", color=color.rgb(0, 0, 0, 100), editable=false)

// Background colors (following US stock market sessions, off-market last to override)
bgcolor(is_pre   ? color.new(color.yellow, 90) : na, title="Pre-Market")
bgcolor(is_after ? color.new(color.purple, 95) : na, title="After-Hours")
bgcolor(is_off   ? color.new(color.blue,   88) : na, title="Off-Market")

Overview

Plotted in a separate pane, the indicator enables traders to observe and compare the relative position of two assets within their recent high-low ranges. Additionally, the indicator features session background coloring to distinguish pre-market and after-hours trading periods.

Details

Published by

realanthonyc on GitHub

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Oscillators & momentum, Sessions & time

Markets

Indices, Crypto

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

indicatorpinescripttradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Main SymbolsymbolES1!sym_main
Secondary SymbolsymbolBTCUSDsym_sec
Lookback Lengthint14length
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

4 stars

Meridian Options Context plots a separate-pane directional context for liquid options underlyings. It normalizes trend from fast and slow EMAs, RTH VWAP and opening-range displacement, RSI and short-return momentum, relative volume participation, persistence,

Indicator v6 Oscillators & momentumMoving averages Repaints
Updated 7 weeks ago · MPL-2.0 GitHub repository of Meridian - Options Context
3 stars

This indicator calculates and plots the NYSE Cumulative Tick Index as colored candles in a separate pane, with green indicating upward tick trends and red downward trends. Overbought and oversold zones are marked using smoothed averages of high and low tick va

Indicator v5 Oscillators & momentumVolatility & bands
Updated 5 months ago · None stated GitHub repository of CSW Tick Internals

Trend Score History

by ryangaraygay
2 stars

Trend Score History calculates a composite trend metric ranging between -5 and +5 by evaluating session VWAP, EMA alignment, price-volume flow, lower-timeframe Donchian channel breakouts, and Opening Range breakouts. It plots the cumulative score as histogram

Indicator v6 TrendOscillators & momentum Repaints
Updated 1 year ago · MIT GitHub repository of Trend Score History

SPY 0DTE Scalper - 15min

by chris-c-thomas
14 stars

This intraday overlay establishes directional bias and high-conviction swing setups for SPY on the 15-minute timeframe. It computes a weighted confluence score combining an EMA ribbon, a 50 EMA anchor, session VWAP bands, RSI divergence, ADX, TTM Squeeze, cand

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · MIT GitHub repository of SPY 0DTE Scalper - 15min
6 stars

The ORB + Fib + MACD Indicator combines Opening Range Breakout mechanics with Fibonacci retracement levels and MACD momentum filtering. It determines the high and low bounds of a user-defined initial session window, projects Fibonacci entry zones, and calculat

Indicator v5 Sessions & timeSupport & resistance
Updated 7 months ago · None stated GitHub repository of ORB + Fib + MACD Indicator

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers