Indicator · Pine Script v6 · On the chart

Multi-Ticker Anchored Candles

by eddiebelaval· code credited to SamRecio

Multi-Ticker Anchored Candles overlays up to three user-selected symbols on the price chart as candles anchored to a chosen period, which defaults to the daily timeframe.

View on GitHub

GitHub stars7on the repository
Pine versionv6current
Lines of code119
Settings17inputs
LicenceNone statedfile: MPL-2.0
Last update3 months ago24 Jul 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

119 lines of Pine Script v6 from pinescript/editors_picks/multi-ticker-anchored-candles.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

multi-ticker-anchored-candles.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SamRecio

//@version=6
indicator("Multi-Ticker Anchored Candles", shorttitle = "MTAC", overlay = true, max_lines_count = 500)

///_____________________________________________________________________________________________________________________
///Inputs
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

period = input.timeframe("D", title = "Period", inline = "anchor", group = "Anchor")
col1 = input.color(color.gray, title = "", inline = "anchor", group = "Anchor")

s1_tog = input.bool(true, title = "", inline  = "symbol1", group = "Symbols")
s1 = input.symbol("NQ1!", title = "Symbol 1", inline  = "symbol1", group = "Symbols")
s1_col = input.color(color.new(#ff033e,25), title = "", inline = "symbol1", group = "Symbols")

s2_tog = input.bool(true, title = "", inline  = "symbol2", group = "Symbols")
s2 = input.symbol("RTY1!", title = "Symbol 2", inline  = "symbol2", group = "Symbols")
s2_col = input.color(color.new(#004d92,25), title = "", inline = "symbol2", group = "Symbols")

s3_tog = input.bool(true, title = "", inline  = "symbol3", group = "Symbols")
s3 = input.symbol("YM1!", title = "Symbol 3", inline  = "symbol3", group = "Symbols")
s3_col = input.color(color.new(#3daa45,25), title = "", inline = "symbol3", group = "Symbols")

show_splits = input.bool(true, title = "Session Breaks", group = "Additional Display Options")
show_open = input.bool(true, title = "Open Price", group = "Additional Display Options")

show_t = input.bool(true, title = "Ticker", group = "Label Options")
show_price = input.bool(true, title = "Price", group = "Label Options")
show_per = input.bool(true, title = "Percent", group = "Label Options")
show_net = input.bool(false, title = "Net", group = "Label Options")

invis = color.rgb(0,0,0,100)

///_____________________________________________________________________________________________________________________
///Setup
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

newtf = timeframe.change(period)

//Chart Data
var float dayo = na
dayo := newtf?open:dayo

///_____________________________________________________________________________________________________________________
///Functions
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

add_plus(_val) => _val > 0 ? "+" : ""

get_lab(_s,_cv,_per,_val) =>
    t = show_t ? str.split(_s,":").get(1) + " " : ""
    price = show_price ? str.tostring(_cv, format.mintick) + " " : ""
    per = show_per ? add_plus(_per) + str.tostring(_per, format.percent) + " " : ""
    net = show_net ? add_plus(_val) + str.tostring(_val, format.mintick) + " " : ""
    t + price + per + net

//Symbol Candles
get_scaled_data(_symbol,_tog) =>
    [s_o,s_h,s_l,s_c] = request.security(_symbol,"",[open,high,low,close])

    var float s_dayo = na
    s_dayo := newtf ? s_o : s_dayo

    s_o_pgain = (1+(s_o - s_dayo) / s_dayo) * dayo
    s_h_pgain = (1+(s_h - s_dayo) / s_dayo) * dayo
    s_l_pgain = (1+(s_l - s_dayo) / s_dayo) * dayo
    s_c_pgain = (1+(s_c - s_dayo) / s_dayo) * dayo

    s_pgain_per = ((s_c_pgain/dayo)-1)*100
    s_value = (s_c - s_dayo) 

    [s_c,s_o_pgain,s_h_pgain,s_l_pgain,s_c_pgain,s_pgain_per,s_value]

///_____________________________________________________________________________________________________________________
///Candle Calcs
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

[s1_cv,s1_o,s1_h,s1_l,s1_c,s1_per,s1_val] = get_scaled_data(s1,s1_tog)
[s2_cv,s2_o,s2_h,s2_l,s2_c,s2_per,s2_val] = get_scaled_data(s2,s2_tog)
[s3_cv,s3_o,s3_h,s3_l,s3_c,s3_per,s3_val] = get_scaled_data(s3,s3_tog)

///_____________________________________________________________________________________________________________________
///Display
///‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

//Symbol 1
    //Candles
plotcandle(s1_o,s1_h,s1_l,s1_c,color = s1_col, wickcolor = s1_col, bordercolor = s1_col, display = s1_tog?display.pane:display.none, title = "Symbol 1 Overlay Candles", editable = false)
    //Label
var s1_lab = label.new(na,na, textcolor = s1_col, style = label.style_label_left, color = invis)
if s1_tog
    s1_lab.set_xy(bar_index+1,math.avg(s1_c,s1_o))
    s1_lab.set_text(get_lab(s1,s1_cv,s1_per,s1_val))

//Symbol 2
    //Candles
plotcandle(s2_o,s2_h,s2_l,s2_c,color = s2_col, wickcolor = s2_col, bordercolor = s2_col, display = s2_tog?display.pane:display.none, title = "Symbol 2 Overlay Candles", editable = false)
    //Label
var s2_lab = label.new(na,na, textcolor = s2_col, style = label.style_label_left, color = invis)
if s2_tog
    s2_lab.set_xy(bar_index+1,math.avg(s2_c,s2_o))
    s2_lab.set_text(get_lab(s2,s2_cv,s2_per,s2_val))

//Symbol 3
    //Candles
plotcandle(s3_o,s3_h,s3_l,s3_c,color = s3_col, wickcolor = s3_col, bordercolor = s3_col, display = s3_tog?display.pane:display.none, title = "Symbol 3 Overlay Candles", editable = false)
    //Label
var s3_lab = label.new(na,na, textcolor = s3_col, style = label.style_label_left, color = invis)
if s3_tog
    s3_lab.set_xy(bar_index+1,math.avg(s3_c,s3_o))
    s3_lab.set_text(get_lab(s3,s3_cv,s3_per,s3_val))

//Period Open
plot(newtf?na:dayo, color = col1, display = show_open?display.all:display.none, style = plot.style_linebr, linestyle = plot.linestyle_dashed, title = "Open Price")

if newtf and show_splits
    line.new(bar_index,low-syminfo.mintick, bar_index,high+syminfo.mintick, extend = extend.both, color = col1, style = line.style_dashed)

Overview

Each symbol has its own color and an on or off toggle. Optional drawings mark session breaks and the period open. Labels can show the ticker, last price, percent change from the anchor open, and net change. The script does not generate trade signals or manage positions.

Details

Published by

eddiebelaval on GitHub

Code credit

SamRecio, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Candlestick patterns, Sessions & time, Support & resistance

Markets

Indices

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
PeriodtimeframeDperiod
col1colorcolor.graycol1
s1_togbooltrues1_tog
Symbol 1symbolNQ1!s1
s1_colcolorcolor.new(#ff033e,25)s1_col
s2_togbooltrues2_tog
Symbol 2symbolRTY1!s2
s2_colcolorcolor.new(#004d92,25)s2_col
s3_togbooltrues3_tog
Symbol 3symbolYM1!s3
s3_colcolorcolor.new(#3daa45,25)s3_col
Session Breaksbooltrueshow_splits
Show all 17 settings
SettingTypeDefaultVariable
Open Pricebooltrueshow_open
Tickerbooltrueshow_t
Pricebooltrueshow_price
Percentbooltrueshow_per
Netboolfalseshow_net
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

56 stars

This overlay indicator highlights candles with a body smaller than 50% of their total range by coloring them white on the price chart. Simultaneously, it calculates and plots horizontal lines for open prices across multiple higher timeframes, such as daily, we

Indicator v6 Support & resistanceCandlestick patterns Repaints
Updated 2 months ago · None stated GitHub repository of Daily Weekly Monthly Yearly Opens

3-Candle Time Pattern

by alboogycOdR
6 stars

This indicator detects three-candle time patterns on the price chart, tracking range, manipulation, and distribution phases based on Smart Money Concepts. It establishes high and low boundaries from the opening candle and identifies boundary rejections during

Indicator v5 SMC / ICT / price actionCandlestick patterns
Updated 7 months ago · None stated GitHub repository of 3-Candle Time Pattern

BPA [yohtza]

by forecho
5 stars

This indicator plots key session-based price action reference levels on the price chart. It calculates and displays the current session open, previous day close, Globex session high and low, weekly open, and higher-timeframe boundaries. It also supports bar co

Indicator v6 Sessions & timeSupport & resistance
Updated 8 weeks ago · None stated GitHub repository of BPA [yohtza]

TheStrat Suite

by 345-strategies
5 stars

TheStrat Suite is a multi-timeframe price action indicator implementing Rob Smith's TheStrat methodology. It calculates bar classifications for inside bars, hammers, shooters, failed 2s and outside bars across configurable timeframes. The indicator detects sig

Indicator v6 SMC / ICT / price actionCandlestick patterns Repaints
Updated 2 days ago · MPL-2.0 GitHub repository of TheStrat Suite

TradeKit

by tanishq-rocks
5 stars

TradeKit is an all-in-one technical analysis indicator that consolidates multiple chart overlays into a single script on the price chart. It plots up to four customizable moving averages (SMA, EMA, SMMA, WMA, or VWMA), Bollinger Bands, VWAP, and reference leve

Indicator v6 Moving averagesCandlestick patterns
Updated 3 months ago · MPL-2.0 GitHub repository of TradeKit
3 stars

Hercules Indicator 1.7 is a multi-filter trade signal generator designed to overlay entry conditions directly on the price chart. It evaluates engulfing candle patterns alongside multiple configurable filters, including trading session windows (Sydney, Tokyo,

Indicator v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Hercules Indicator 1.7

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