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 :(
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
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')