[RS]MTF Ichimoku Cloud V0

157 2 14
Request for T_C

The displacement cant be converted (a approximation is possible by calculating the n_bars the time frame occupies by the displacement).
Remove from Favorite Scripts Add to Favorite Scripts
study(title='[RS]MTF Ichimoku Cloud V0', shorttitle='IC', overlay=true)
tf = input(title='Timeframe:', type=string, defval='D', confirm=false)
conversionPeriods = input(title='Conversion Periods:', type=integer, defval=9, minval=1),
basePeriods = input(title='Base Periods', type=integer, defval=26, minval=1)
laggingSpan2Periods = input(title='Lagging Span:', type=integer, defval=52, minval=1),
displacement = input(title='Displacement:', type=integer, defval=26, minval=1)

f_donchian(_len) => avg(lowest(_len), highest(_len))

f_ichimoku_cloud(_conversion_periods, _base_periods, _lagging_span)=>
    _conversion_line = f_donchian(_conversion_periods)
    _base_line = f_donchian(_base_periods)
    _lead_line1 = avg(_conversion_line, _base_line)
    _lead_line2 = f_donchian(_lagging_span)
    [_conversion_line, _base_line, _lead_line1, _lead_line2]

[conversionLine, baseLine, leadLine1, leadLine2] = f_ichimoku_cloud(conversionPeriods, basePeriods, laggingSpan2Periods)

s0 = security(tickerid, tf, offset(leadLine1, displacement))
s1 = security(tickerid, tf, offset(leadLine2, displacement))
s2 = security(tickerid, tf, baseLine)
s3 = security(tickerid, tf, conversionLine)

ps0 = plot(title='A', series=s0, color=green, linewidth=2)
ps1 = plot(title='B', series=s1, color=red, linewidth=2)
fill(title='AB', plot1=ps0, plot2=ps1, color=blue, transp=80)
plot(title='Base', series=s2, color=blue, linewidth=1)
plot(title='Conversion', series=s3, color=orange, linewidth=1)

a year ago
Thank you so much RicardoSantos. That is what I was looking for. The script now plots the 1h Ichimoku onto whatever time frame I chose.
The question is: how can I add more time frames (monthly, weekly, hourly, minutes)?
Alex_Savin Alex_Savin
a year ago
Never mind, I found out how to do it. Thanks again!
Ideas Scripts Chart
United States
United Kingdom
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out