munkeefonix

Ichimoku Cloud Time

Ichimoku Cloud that will remain fixed to a time interval. Might be useful to someone wanting to use multiple Ichimoku Clouds on a single time frame.

Input values:
Daily Interval: If checked then days are used for the interval. If unchecked then minutes will be used.
Interval: The interval to use for the indicator.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//  Ichimoku Cloud that will remain fixed to a time interval. 
//
//  @author munkeefonix
//  https://www.tradingview.com/u/munkeefonix/
//
//  Input values:
//  Daily Interval: If checked then days are used for the interval.  If unchecked then minutes will be used.
//  Interval: The interval to use for the indicator. 

study("Ichimoku Cloud Time", shorttitle="Ichi Time", overlay=true)

multIntra()=>(isintraday ? 1.0 : (isdaily ? 1440.0 : isweekly ? 10080.0 : 43320.0))
multDaily()=>multIntra() / 1440.0

_con=input(9, "Conversion", integer, minval=1)
_turn=input(26, "Turn", integer, minval=1)
_lag=input(52, "Lag", integer, minval=1)
_offset=input(26, "Displacement", integer, minval=1)
_useDaily=input(false, "Daily Interval")
_t=input(60.0, "Interval", float, minval=1.0) / (_useDaily ? multDaily() : multIntra())

per(v, p)=> round(v * (p / interval))
conversion (c,p)=> ((highest(high, per(c, p))+lowest(low, per(c, p))) / 2.0) 
senkouA (p)=> ((conversion(_con, p) + conversion(_turn, p)) / 2.0) 

_offsetAdj=per(_offset, _t)
 
sA = plot(senkouA(_t), color=#999999, offset=_offsetAdj, title="Leading Span A", linewidth=1)
sB = plot(conversion(_lag, _t), color=#999999, offset=_offsetAdj, title="Leading Span B", linewidth=2)
fill(sA, sB, color=#333333, transp=60, title="Leading Fill Color")
 
plot(conversion(_con, _t), color=#006699, linewidth=2, title="Conversion Line")
plot(conversion(_turn, _t), color=#0099CC, linewidth=2, title="Base Line")
plot(close, color=#333333, linewidth=1, offset=-_offsetAdj, title="Lagging Span")