Indicator · Pine Script v6 · On the chart

Monthly Seasonality

by piecioshka

Monthly Seasonality colors the price chart background according to the calendar month using an HSV color wheel gradient spanning winter through autumn.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code93
Settings15inputs
LicenceMIT
Last update10 days ago18 Oct 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

93 lines of Pine Script v6 from indicators/seasonality/monthly-seasonality/monthly-seasonality.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

monthly-seasonality.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Piotr Kowalski "piecioshka"
// Docs (EN): https://github.com/piecioshka/tradingview-pine-scripts/blob/main/indicators/seasonality/monthly-seasonality/monthly-seasonality.md
// Docs (PL): https://github.com/piecioshka/tradingview-pine-scripts/blob/main/indicators/seasonality/monthly-seasonality/monthly-seasonality.pl.md

//@version=6
indicator('Monthly Seasonality', overlay = true)

// Colors the chart background differently depending on the month.
// Designed for the monthly timeframe (1M) - every candle = one month.
// Colors follow a gradient around the HSV color wheel (winter → spring → summer → autumn → winter),
// which makes recurring seasonal patterns easy to spot (e.g. Lean Hogs).

transp = input.int(title='Transparency (0-100)', defval=80, minval=0, maxval=100, step=5)
showLegend = input.bool(title='Show legend', defval=true)
legendPosition = input.string(title='Legend position', defval='Top right', options=['Top left', 'Top right', 'Bottom left', 'Bottom right'])

// Enable/disable individual months.
// Useful for contracts not available in all months
// (e.g. Lean Hogs / HE - only 8 months: G, J, K, M, N, Q, V, Z).
gMonths = 'Months'
useJan = input.bool(title='January (F)',   defval=true, group=gMonths)
useFeb = input.bool(title='February (G)',  defval=true, group=gMonths)
useMar = input.bool(title='March (H)',     defval=true, group=gMonths)
useApr = input.bool(title='April (J)',     defval=true, group=gMonths)
useMay = input.bool(title='May (K)',       defval=true, group=gMonths)
useJun = input.bool(title='June (M)',      defval=true, group=gMonths)
useJul = input.bool(title='July (N)',      defval=true, group=gMonths)
useAug = input.bool(title='August (Q)',    defval=true, group=gMonths)
useSep = input.bool(title='September (U)', defval=true, group=gMonths)
useOct = input.bool(title='October (V)',   defval=true, group=gMonths)
useNov = input.bool(title='November (X)',  defval=true, group=gMonths)
useDec = input.bool(title='December (Z)',  defval=true, group=gMonths)

// 12 colors - a gradient around the HSV color wheel
colJan = color.rgb(30, 60, 200)     // January - navy (deep winter)
colFeb = color.rgb(0, 140, 220)     // February - blue
colMar = color.rgb(0, 180, 170)     // March - turquoise (early spring)
colApr = color.rgb(60, 180, 60)     // April - green (spring)
colMay = color.rgb(160, 200, 50)    // May - lime
colJun = color.rgb(230, 220, 0)     // June - yellow (early summer)
colJul = color.rgb(240, 160, 0)     // July - orange (high summer)
colAug = color.rgb(230, 100, 30)    // August - red-orange
colSep = color.rgb(220, 50, 50)     // September - red (autumn)
colOct = color.rgb(200, 50, 140)    // October - magenta
colNov = color.rgb(160, 60, 190)    // November - violet
colDec = color.rgb(90, 60, 200)     // December - dark violet (back to winter)

m = month(time)

bgCol = switch m
    1  => useJan ? color.new(colJan, transp) : na
    2  => useFeb ? color.new(colFeb, transp) : na
    3  => useMar ? color.new(colMar, transp) : na
    4  => useApr ? color.new(colApr, transp) : na
    5  => useMay ? color.new(colMay, transp) : na
    6  => useJun ? color.new(colJun, transp) : na
    7  => useJul ? color.new(colJul, transp) : na
    8  => useAug ? color.new(colAug, transp) : na
    9  => useSep ? color.new(colSep, transp) : na
    10 => useOct ? color.new(colOct, transp) : na
    11 => useNov ? color.new(colNov, transp) : na
    12 => useDec ? color.new(colDec, transp) : na
    => na

bgcolor(bgCol)

// Legend - a table showing which months have which color
if showLegend and barstate.islast
    pos = switch legendPosition
        'Top left'     => position.top_left
        'Top right'    => position.top_right
        'Bottom left'  => position.bottom_left
        'Bottom right' => position.bottom_right
        =>                position.top_right

    months = array.from('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
    colors = array.from(colJan, colFeb, colMar, colApr, colMay, colJun, colJul, colAug, colSep, colOct, colNov, colDec)
    enabled = array.from(useJan, useFeb, useMar, useApr, useMay, useJun, useJul, useAug, useSep, useOct, useNov, useDec)

    activeCount = 0
    for i = 0 to 11
        if array.get(enabled, i)
            activeCount += 1

    if activeCount > 0
        legend = table.new(position = pos, columns = 2, rows = activeCount, border_width = 1)
        row = 0
        for i = 0 to 11
            if array.get(enabled, i)
                table.cell(legend, 0, row, '    ', bgcolor = array.get(colors, i))
                table.cell(legend, 1, row, array.get(months, i), text_color = color.white, bgcolor = color.new(color.black, 30))
                row += 1

Overview

Primarily designed for monthly timeframes, it helps identify recurring seasonal cycles across markets, such as commodity futures. Users can adjust background transparency, individually toggle each month on or off using standard futures month codes, and display an on-chart legend with configurable positioning. The script acts purely as a visual backdrop and does not generate trading signals.

Details

Published by

piecioshka on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Sessions & time

Markets

Oil & commodities

Timeframes

H4 and above

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

pinescriptpinescript-indicatorspinescript-strategiestradingtradingview

Settings

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

SettingTypeDefaultVariable
Transparency (0-100)int80transp
Show legendbooltrueshowLegend
Legend positionstringTop rightlegendPosition
January (F)booltrueuseJan
February (G)booltrueuseFeb
March (H)booltrueuseMar
April (J)booltrueuseApr
May (K)booltrueuseMay
June (M)booltrueuseJun
July (N)booltrueuseJul
August (Q)booltrueuseAug
September (U)booltrueuseSep
Show all 15 settings
SettingTypeDefaultVariable
October (V)booltrueuseOct
November (X)booltrueuseNov
December (Z)booltrueuseDec
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

948 stars

This indicator counts down to a fixed Litecoin halving timestamp in August 2019, using Greenwich Mean Time. It subtracts the current time from that stamp and formats the remaining days, hours, minutes, and seconds. The day, hour, and minute of the target are u

Indicator v4 Sessions & time
Updated 10 days ago · GPL-3.0 GitHub repository of Litecoin Halving UTC Countdown
575 stars

This indicator builds Market Profile Time Price Opportunity (TPO) structures across defined session timeframes directly on the main price chart. It visualizes the Point of Control (POC) and Value Area boundaries using dynamic box drawings. An integrated multi-

Indicator v5 Support & resistanceScreeners & dashboards
Updated 1 year ago · MPL-2.0 GitHub repository of Market Profile with Screener

This indicator identifies and plots key options expiration dates on the price chart. It calculates monthly OpEx (the third Friday of each month), quarterly OpEx (March, June, September, December), and corresponding VIX expiration dates, drawing vertical lines

Indicator v6 Sessions & time
Updated 2 months ago · MIT GitHub repository of Expiration Highlights: Opex, Quarterly Opex & VIX with Vanna/Charm
257 stars

This indicator plots auto trade signals for E-mini S&P 500 futures on the price chart. It computes an EMA200 filter along with day ETH RTH session levels and percentage-based entry zones. Signals trigger CALL or PUT cases when price crosses defined thresholds

Indicator v6 TrendSupport & resistance
Updated 6 weeks ago · None stated GitHub repository of Auto Trade Futures ES
219 stars

This indicator plots reference levels for previous daily high and low prices directly on the price chart. It requests daily timeframe data using the security function and plots the offset values as continuous lines, displaying resistance in red and support in

Indicator v4 Support & resistanceSessions & time
Updated 5 years ago · None stated GitHub repository of 昨日高低點標示

Golden Bullet Strategy

by TradersPost
218 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 3 months ago · None stated GitHub repository of Golden Bullet Strategy

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