1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
421 lines of Pine Script v5 from Tradingview/mtf-candles-mas.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
MTF Candles + MAs fetches OHLC data from timeframes 5, 15, 30, 60, and daily, displaying them clustered with customizable colors for bullish and bearish bodies, borders, and wicks. Selected timeframes include moving averages for trend visualization. Options allow enabling or disabling each timeframe and its MA, adjusting padding between candles and from the last candle, and adding timeframe labels. The script draws directly on the price chart and uses lookahead to fetch data from higher timeframes.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Body
color
color.green
css_bull_body
css_bear_body
color
color.rgb(234, 21, 21)
css_bear_body
Border
color
color.lime
css_bull_border
css_bear_border
color
color.red
css_bear_border
Wick
color
color.lime
css_bull_wick
css_bear_wick
color
color.red
css_bear_wick
MTF Label
bool
true
use_label
css_label
color
color.new(#434651,0)
css_label
label_size
string
Medium
label_size
Padding From Last Candle
int
10
padding
Padding Between MTF Candles
int
3
padding_b
HTF 1
bool
true
use_tf1
Show all 40 settings
Setting
Type
Default
Variable
HTF 2
bool
true
use_tf2
HTF 3
bool
true
use_tf3
HTF 4
bool
true
use_tf4
HTF 5
bool
true
use_tf5
tf1
timeframe
5
tf1
tf2
timeframe
15
tf2
tf3
timeframe
30
tf3
tf4
timeframe
60
tf4
tf5
timeframe
D
tf5
tf1_bars
int
8
tf1_bars
tf2_bars
int
8
tf2_bars
tf3_bars
int
8
tf3_bars
tf4_bars
int
8
tf4_bars
tf5_bars
int
8
tf5_bars
HTF 1 MA
bool
true
use_tf1_ma
HTF 2 MA
bool
true
use_tf2_ma
HTF 3 MA
bool
true
use_tf3_ma
HTF 4 MA
bool
true
use_tf4_ma
HTF 5 MA
bool
true
use_tf5_ma
tf1_ma_type
string
SMA
tf1_ma_type
tf2_ma_type
string
SMA
tf2_ma_type
tf3_ma_type
string
SMA
tf3_ma_type
tf4_ma_type
string
SMA
tf4_ma_type
tf5_ma_type
string
SMA
tf5_ma_type
tf1_ma_length
int
20
tf1_ma_length
tf2_ma_length
int
20
tf2_ma_length
tf3_ma_length
int
20
tf3_ma_length
tf4_ma_length
int
20
tf4_ma_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.
Mean Reversion Study is an indicator that identifies trade setups combining exponential moving averages, RSI extremes, and engulfing candlestick patterns. It highlights bullish setups when a bullish engulfing candle forms below the EMA while RSI is oversold, a
This educational script demonstrates custom candlestick rendering on the price chart using the plotcandle function. It calculates a 20-period Simple Moving Average and checks if the bar's low price remains strictly above it. When the condition is met, the indi
This indicator identifies candlestick patterns on the price chart by combining price action with momentum factors and trend filters. It calculates one of four selectable oscillators: Karobein Oscillator, Money Flow Index, RSI, or Stochastic, alongside trend ru
This indicator draws smoothed candlesticks on the price chart. It applies a simple moving average of a user-set length, defaulting to nine, separately to open, high, low, and close, then plots those four values with plotcandle. Wick color is green when the raw
Major Buy Setup plots a 20-period and a 50-period simple moving average on the price chart. It marks a buy when the current bar is both a bullish engulfing candle and a bald bull candle, defined as a green candle whose upper shadow is no more than five percent
30 min Pivot is an overlay indicator that plots an exponential moving average (EMA) calculated from a specified timeframe (default 30 minutes) and flags specific multi-bar candle setups. It checks the relative distance between price and the higher-timeframe EM