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')