//@version=5 indicator("Custom Ichimoku Cloud [birdsongs]", shorttitle="Ichimoku [birdsongs]", overlay=true) // User Inputs for customization conversionLinePeriod = input.int(9, title="Conversion Line Period", minval=1, tooltip="Typically 9 periods.") baseLinePeriod = input.int(26, title="Base Line Period", minval=1, tooltip="Typically 26 periods.") leadingSpanBPeriod = input.int(52, title="Leading Span B Period", minval=1, tooltip="Typically 52 periods.") displacement = input.int(26, title="Displacement", minval=1, tooltip="Typically 26 periods, used for shifting the Leading Spans forward.") // Calculate Ichimoku components conversionLine = (ta.highest(high, conversionLinePeriod) + ta.lowest(low, conversionLinePeriod)) / 2 baseLine = (ta.highest(high, baseLinePeriod) + ta.lowest(low, baseLinePeriod)) / 2 leadingSpanA = (conversionLine + baseLine) / 2 leadingSpanB = (ta.highest(high, leadingSpanBPeriod) + ta.lowest(low, leadingSpanBPeriod)) / 2 laggingSpan = close[displacement] // Plot the lines and store plot references p_conversionLine = plot(conversionLine, color=color.blue, title="Conversion Line") p_baseLine = plot(baseLine, color=color.red, title="Base Line") p_leadingSpanA = plot(leadingSpanA, offset=displacement, color=color.green, title="Leading Span A") p_leadingSpanB = plot(leadingSpanB, offset=displacement, color=color.orange, title="Leading Span B") p_laggingSpan = plot(laggingSpan, offset=-displacement, color=color.purple, title="Lagging Span") // Fill between Leading Span A and Leading Span B fill(p_leadingSpanA, p_leadingSpanB, color=leadingSpanA > leadingSpanB ? color.new(color.green, 90) : color.new(color.red, 90), title="Kumo Cloud")