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 :(
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
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')