Indicator · Pine Script v5 · On the chart

Heat Map Seasons

by regalouisei· code credited to VanHe1sing

Heat Map Seasons plots a linear regression of typical price and colors each price bar by how far close sits from that line.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code79
Settings3inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago25 Feb 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

79 lines of Pine Script v5 from pinescript/editors_picks/heat-map-seasons.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

heat-map-seasons.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © VanHe1sing

//@version=5
indicator("Heat Map Seasons", shorttitle = "HeatMapS", overlay =  true)

// ————— User Inputs 
int Length         = input.int(200, "Length")
int heat_sensative = input.int(70, "Heat Sensitivity", step = 10)
bool show_line     = input.bool(true, "Show Regression Line?")


// ————— Normalization Function
normalization(src, mean)=> 
    norm = (src - mean) / ta.stdev(src, 200)
    norm > 5 ? 5 : norm < -5 ? -5 : norm

// ————— Rescale Function (when range is known).
rescale(_src, _oldMin, _oldMax, _newMin, _newMax) =>
    _newMin + (_newMax - _newMin) * (_src - _oldMin) / math.max(_oldMax - _oldMin, 10e-10)

// ————— Regression Line Formula
Regression_Line(length)=>
    x  = bar_index
    y  = hl2
    x_ = ta.sma(x,length)
    y_ = ta.sma(y,length)
    mx = ta.stdev(x,length)
    my = ta.stdev(y,length)
    c  = ta.correlation(x,y,length)
    // -
    slope = c * (my/mx)
    inter = y_ - slope*x_
    // -
    x*slope + inter

Regression_Line = Regression_Line(Length)

// ————— Heat Map Color Bars
color_level = normalization(close - Regression_Line, 0)

color = color_level > 0 
 ? color.from_gradient(color_level, 0, ta.highest(color_level, heat_sensative), color.yellow, color.red)
 : color.from_gradient(color_level, ta.lowest(color_level, heat_sensative), 0, color.aqua, color.yellow)
barcolor(color)

// Plot of Regression_Line
plot(show_line ? Regression_Line : na, color = color.rgb(120, 123, 134, 60), linewidth = 1
 , style = plot.style_stepline_diamond)


// ————— Plot Gauge 
tbl = table.new(position.bottom_center, 100, 10)

for i = 0 to 29 by 1
    table.cell(tbl, i, 1, "",
     bgcolor = i < 15 
      ? color.from_gradient(i, 0, 15, color.aqua, color.yellow) 
         : color.from_gradient(i, 15, 30, color.yellow, color.red)
          )

// Gauge point 
g_p = rescale(color_level, -4, 5, 0, 30)

// Summer Winter marks and gauge point
table.cell(tbl, 0, 1, "❆", text_color = color.rgb(32, 91, 255), text_size = size.large, bgcolor = color.aqua)
table.cell(tbl, 29, 1, "☀︎", text_color = color.rgb(255, 238, 0), text_size = size.large, bgcolor = color.red)

table.cell(tbl, math.round(g_p < 0 ? 0 : g_p), 1, "𖦹", text_color = color.rgb(0, 0, 0), text_size = size.large
 , bgcolor = color)

table.cell(tbl, 35, 0,
 "☀︎ - Summer\n❆ - Winter\n𖦹 - Current Season\n " + "     Value: " + str.tostring(math.round(g_p < 0 ? 0 : g_p)-15),
  text_halign = text.align_left,
   text_color = color.gray
   )


// ❅ ❆ ❃ ❊ ❉ ☀︎ 𖦹

Overview

Heat Map Seasons normalizes the gap with standard deviation, clamps extreme values, and maps them from aqua through yellow to red using a heat-sensitivity window. Length sets the regression window, heat sensitivity sets the color scale, and an optional stepline shows the regression. A bottom table marks winter to summer and the current reading. It does not generate trade signals.

Details

Published by

regalouisei on GitHub

Code credit

VanHe1sing, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Volatility & bands, Screeners & dashboards

Markets

Any symbol

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.

Settings

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

SettingTypeDefaultVariable
Lengthint200Length
Heat Sensitivityint70heat_sensative
Show Regression Line?booltrueshow_line
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

92 stars

This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It

Indicator v5 Volatility & bandsTrend
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Regime & Trap
46 stars

This indicator uses a Hidden Markov Model (HMM) framework combined with an adaptive dual moving average engine and Directional Movement Index (DMI) features to identify market regimes (bullish, bearish, or ranging/chop). It calculates regime probabilities on e

Indicator v5 AI / machine learningTrend
Updated 7 weeks ago · None stated GitHub repository of HMM Enhanced: Regime Probability
43 stars

This indicator calculates standardized trend strength and historical volatility to estimate position sizes. It computes the differences between three user-defined EMAs standardized by price using MACD logic, while historical volatility is derived from the stan

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility v2

This overlay indicator plots a SuperTrend-style band on the price chart using ATR length, a selectable source, and a base factor. Optional settings enable an adaptive factor driven by rate of change, a volatility filter, K-means clustering, and an LSTM layer w

Indicator v6 TrendVolatility & bands
Updated 4 months ago · MIT GitHub repository of ML SuperTrend (Ultimate) - Auto-Optimized AI with LSTM

Adaptive Fair Value Cloud calculates a volatility-adaptive fair value channel around a selectable centerline, such as KAMA, EMA, linear regression, or VWMA. It blends ATR and mean deviation with volatility percentiles and trend sensors, including ADX, Efficien

Indicator v6 Volatility & bandsTrend
Updated yesterday · MIT GitHub repository of Adaptive Fair Value Cloud [WavesUnchained]

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