ChartArt

Stocks Box (by ChartArt)

Get a multi-time frame (MTF) view of the price!

You can select to see either close price (default), or HL2 price, or HLC3 price, or OHLC4 price of all time-frames.And you change the smoothing method (and smoothing period) of the daily price, which is shown as a blue line, with period 10 WMA smoothing as default.


P:S. I had the drawings on the chart hidden, because they have nothing to do with the indicator, but with publishing the script they showed up again :(
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
study(title="Stocks Box (by ChartArt)", shorttitle="CA_-_StocksBox")

// Version 1.0
// Idea by ChartArt on April 21, 2015.
//
// PLEASE ADJUST SCALING ON THE RIGHT MANUALLY
//
// The indicator overlays different time-frames (daily, weekly, monthly)
// on top of each other with three colors to visualize the price.
// The daily price is green, the weekly orange, the monthly fuchsia.
// 
// Additionally the daily price can be smoothed.
// The default smoothing is a weighted moving average (WMA)
// for the last 10 days shown in blue. 
// 
// List of my work: 
// https://www.tradingview.com/u/ChartArt/

resD = input(defval="D", type=resolution, title='Daily')
resW = input(defval="W", type=resolution, title='Weekly')
resM = input(defval="M", type=resolution, title='Monthly')

priceinput = input(1, minval=1, maxval=4, title='Price Source: (1 = Close), (2 = OHLC4), (3 = HLC3), (4 = HL2)')

price = priceinput == 1 ? close :
    priceinput == 2 ? ohlc4 :
    priceinput == 3 ? hlc3 :
    priceinput == 4 ? hl2 :
    na

daily  = security(tickerid,resD, price)
weekly = security(tickerid,resW, price)
monthly = security(tickerid,resM, price)

smoothinput = input(5, minval=1, maxval=6, title='Smooth Daily With: (1 = No Smoothing), (2 = Triangular), (3 = SMA), (4 = EMA), (5 = WMA), (6 = Linear)')
smoothlength = input(10, minval=1, title='Smooth Daily Period: (1 = 1 day), (2 = 2 days), (3 = 3 days) ...')
dailyS = smoothinput == 1 ? daily :
    smoothinput == 2 ? swma(daily) :
    smoothinput == 3 ? sma(daily, smoothlength) :
    smoothinput == 4 ? ema(daily, smoothlength) :
    smoothinput == 5 ? wma(daily, smoothlength) :
    smoothinput == 6 ? linreg(daily, smoothlength,0) :
    na

//plot(daily,color=lime, title='Daily',linewidth=2)
plot(dailyS,color=aqua, title='Daily Smoothed')
plot(weekly,color=orange, title='Weekly')
plot(monthly,color=fuchsia, title='Monthly')

plot(daily,color=lime,style=area, transp=85, title='Daily')
plot(dailyS,color=aqua,style=area, transp=95, title='Daily Smoothed')
plot(weekly,color=orange,style=area, transp=95, title='Weekly')
plot(monthly,color=fuchsia,style=area, transp=95, title='Monthly')