Indicator · Pine Script v5 · On the chart

Multi Timeframe Support and Resistance [ABA Invest]

by theonetrade· code credited to ABA Invest

Calculates and plots support and resistance levels derived from pivot highs and pivot lows across multiple timeframes.

View on GitHub

GitHub stars34on the repository
Pine versionv5runs as is
Lines of code74
Settings12inputs
LicenceMIT
Last update2 weeks ago8 Nov 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

74 lines of Pine Script v5 from assets/indicator/bit-exact/multi_timeframe_support_and_resistance_aba_invest_kO82pg19.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

multi_timeframe_support_and_resistance_aba_invest_kO82pg19.pine
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © ABA Invest

//@version = 5
indicator(title="Multi Timeframe Support and Resistance [ABA Invest]", shorttitle = "MTF SnR [ABA Invest]", overlay = true)

// SnR Levels
bars                    = input.int(15, title = "Pivot")
tipe                    = input.string("Body", title = "Type", options = ["Wick", "Body"])

show_c                = input.bool(true, title = "Current Timeframe", group = "Timeframes")

show_5m                 = input.bool(false, title = "M5", group = "Timeframes")
show_15m                = input.bool(false, title = "M15", group = "Timeframes")
show_30m                = input.bool(false, title = "M30", group = "Timeframes")
show_1h                 = input.bool(false, title = "H1", group = "Timeframes")
show_4h                 = input.bool(false, title = "H4", group = "Timeframes")
show_d                  = input.bool(false, title = "Daily", group = "Timeframes")
show_w                  = input.bool(false, title = "Weekly", group = "Timeframes")

pivot_high_5m           = fixnan(request.security(syminfo.tickerid, "5", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_15m          = fixnan(request.security(syminfo.tickerid, "15", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_30m          = fixnan(request.security(syminfo.tickerid, "30", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_1h           = fixnan(request.security(syminfo.tickerid, "60", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_4h           = fixnan(request.security(syminfo.tickerid, "240", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_d            = fixnan(request.security(syminfo.tickerid, "D", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_w            = fixnan(request.security(syminfo.tickerid, "W", ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1]))
pivot_high_c            = fixnan(ta.pivothigh(tipe == "Wick" ? high : close, bars, bars)[1])

pivot_low_5m           = fixnan(request.security(syminfo.tickerid, "5", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_15m          = fixnan(request.security(syminfo.tickerid, "15", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_30m          = fixnan(request.security(syminfo.tickerid, "30", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_1h           = fixnan(request.security(syminfo.tickerid, "60", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_4h           = fixnan(request.security(syminfo.tickerid, "240", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_d            = fixnan(request.security(syminfo.tickerid, "D", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_w            = fixnan(request.security(syminfo.tickerid, "W", ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1]))
pivot_low_c            = fixnan(ta.pivotlow(tipe == "Wick" ? low : close, bars, bars)[1])

resistance_high_5m     = plot(show_5m ? pivot_high_5m : na, color=ta.change(pivot_high_5m) ? na : #00aeff, offset = -bars - 1,  linewidth=2, title="Resistance M5")
resistance_low_5m     = plot(show_5m ? pivot_low_5m : na, color=ta.change(pivot_low_5m) ? na : #ffbf00, offset = -bars - 1, linewidth=2, title="Support M5")

resistance_high_15m    = plot(show_15m ? pivot_high_15m : na, color=ta.change(pivot_high_15m) ? na : #00aeffdd, offset = -bars - 1, linewidth=2, title="Resistance M15")
resistance_low_15m    = plot(show_15m ? pivot_low_15m : na, color=ta.change(pivot_low_15m) ? na : #ffbf00dd, offset = -bars - 1, linewidth=2, title="Support M15")

resistance_high_30m    = plot(show_30m ? pivot_high_30m : na, color=ta.change(pivot_high_30m) ? na : #00aeffbb, offset = -bars - 1, linewidth=2, title="Resistance M30")
resistance_low_30m    = plot(show_30m ? pivot_low_30m : na, color=ta.change(pivot_low_30m) ? na : #ffbf00bb, offset = -bars - 1, linewidth=2, title="Support M30")

resistance_high_1h     = plot(show_1h ? pivot_high_1h : na, color=ta.change(pivot_high_1h) ? na : #00aeff90, offset = -bars - 1, linewidth=2, title="Resistance H1")
resistance_low_1h     = plot(show_1h ? pivot_low_1h : na, color=ta.change(pivot_low_1h) ? na : #ffbf0090, offset = -bars - 1, linewidth=2, title="Support H1")

resistance_high_4h     = plot(show_4h ? pivot_high_4h : na, color=ta.change(pivot_high_4h) ? na : #00aeff70, offset = -bars - 1, linewidth=2, title="Resistance H4")
resistance_low_4h     = plot(show_4h ? pivot_low_4h : na, color=ta.change(pivot_low_4h) ? na : #ffbf0070, offset = -bars - 1, linewidth=2, title="Support H4")

resistance_high_d      = plot(show_d ? pivot_high_d : na, color=ta.change(pivot_high_d) ? na : #00aeff50, offset = -bars - 1, linewidth=2, title="Resistance Daily")
resistance_low_d      = plot(show_d ? pivot_low_d : na, color=ta.change(pivot_low_d) ? na : #ffbf0050, offset = -bars - 1, linewidth=2, title="Support Daily")

resistance_high_w      = plot(show_w ? pivot_high_w : na, color=ta.change(pivot_high_w) ? na : #00aeff30, offset = -bars - 1, linewidth=2, title="Resistance Weekly")
resistance_low_w      = plot(show_w ? pivot_low_w : na, color=ta.change(pivot_low_w) ? na : #ffbf0030, offset = -bars - 1, linewidth=2, title="Support Weekly")

resistance_high_c      = plot(show_c ? pivot_high_c : na, color=ta.change(pivot_high_c) ? na : #ff0040, offset = -bars - 1, linewidth=2, title="Resistance Current Timeframe")
resistance_low_c      = plot(show_c ? pivot_low_c : na, color=ta.change(pivot_low_c) ? na : #6aff00, offset = -bars - 1, linewidth=2, title="Support Current Timeframe")

// Adaptive Moving Average
plot_ama                = input.bool(false, title = "Adaptive Moving Average")
ama_length              = input.int(15, title = "Line Length")
amarc                 = close
float ama               = 0
hh                      = math.max(math.sign(ta.change(ta.highest(ama_length))),0)
ll                      = math.max(math.sign(ta.change(ta.lowest(ama_length))*-1),0)
tc                      = math.pow(ta.sma(hh or ll ? 1 : 0,ama_length),2)

ama := nz(ama[1]+tc*(amarc-ama[1]),amarc)

garis_ama               = plot(plot_ama ? ama : na,"Adaptive Moving Average",#ffffff,2)

Overview

Traded levels can be toggled for individual timeframes ranging from five-minute to weekly charts, as well as the current chart timeframe. Users can configure the pivot detection lookback period and choose whether pivots are calculated using candle wicks or candle bodies. An optional adaptive moving average can also be rendered directly on the price chart.

Details

Published by

theonetrade on GitHub

Code credit

ABA Invest, as written in the script's header

Draws

On the price chart

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.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
Pivotint15bars
TypestringBodytipe
Current Timeframebooltrueshow_c
M5boolfalseshow_5m
M15boolfalseshow_15m
M30boolfalseshow_30m
H1boolfalseshow_1h
H4boolfalseshow_4h
Dailyboolfalseshow_d
Weeklyboolfalseshow_w
Adaptive Moving Averageboolfalseplot_ama
Line Lengthint15ama_length
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

947 stars

Moving Average Channel plots separate simple moving averages for upper and lower bands on the price chart. It fills the space between bands with semi-transparent color and colors bars green above the upper band, red below the lower band, or gray in between. Us

Indicator v4 Moving averagesSupport & resistance
Updated 5 weeks ago · GPL-3.0 GitHub repository of Moving Average Channel

PivotHighLow

by Alorse
368 stars

This indicator calculates pivot high and pivot low points on the price chart based on configurable left and right bar counts. Confirmed pivot highs and lows are plotted with negative bar offsets directly on the price chart using line and cross styles. Addition

Indicator v4 Support & resistanceOscillators & momentum Repaints
Updated 3 months ago · None stated GitHub repository of PivotHighLow

Midnight VWAP

by TradersPost
228 stars

The Midnight VWAP indicator calculates and overlays two distinct Volume Weighted Average Price (VWAP) lines on the price chart based on customizable session timeframes. It tracks an overnight or pre-market session alongside regular trading hours, resetting cal

Indicator v6 Moving averagesSessions & time
Updated 4 months ago · None stated GitHub repository of Midnight VWAP

Ichimoku Cloud

by harryguiacorn
220 stars

This indicator plots Ichimoku Cloud elements on the price chart, including Tenkan-sen, Kijun-sen, Senkou Span A and B lines with optional Chikou Span. It signals trend changes via Tenkan-sen and Kijun-sen crosses and places arrows at Kijun-sen direction shifts

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ichimoku Cloud

Deduct

by TaichiS
219 stars

This indicator displays moving average deduction reference points directly on the price chart. It plots dynamic labels on historical bars corresponding to short, medium, and long lookback periods, defaulted to 20, 60, and 120 bars. Each text label displays the

Indicator v4 Moving averagesSupport & resistance
Updated 5 years ago · None stated GitHub repository of Deduct

More Support & resistance scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers