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).
The displacement cant be converted (a approximation is possible by calculating the n_bars the time frame occupies by the displacement).
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)