RicardoSantos

[RS]MTF Ichimoku Cloud V0

1098 views
54
1098 2
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)

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)?
Reply
Alex_Savin Alex_Savin
Never mind, I found out how to do it. Thanks again!
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Pine Wizards Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out