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 :(
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?
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')