← Script Marketplace
Open-source scriptindicator/v1

Ichimoku Cloud

by Kodexius·@kodexius·

Combine conversion, base, leading-span, and lagging-span lines in one trend framework.

#channel#ichimoku#trend
Ichimoku Cloud chart preview

Description

Ichimoku Cloud compares short, medium, and long price ranges. The conversion and base lines describe current balance, the displaced leading spans form a forward cloud, and the lagging span places current price into historical context.

Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.

Release notes

Version history · 1 published version

Version 1CurrentChart updatedIchimoku Cloud · Aug 31, 2026
Release notes

Initial classic indicator release.

View current source ↓
Source codempl-2.0View source

indicator("Ichimoku Cloud", { overlay: true });
const conversionLength = input.int("Conversion Length", 9, { min: 1, max: 200 });
const baseLength = input.int("Base Length", 26, { min: 1, max: 300 });
const spanLength = input.int("Leading Span B Length", 52, { min: 1, max: 500 });
const midpoint = (len) => {
  const hi = highest(high, len);
  const lo = lowest(low, len);
  return hi.map((v, i) => (v + lo[i]) / 2);
};
const conversion = midpoint(conversionLength);
const base = midpoint(baseLength);
const spanA = conversion.map((v, i) => (v + base[i]) / 2);
const spanB = midpoint(spanLength);
plot(conversion, { title: "Conversion Line", color: "#2962ff" });
plot(base, { title: "Base Line", color: "#ef5350" });
plot(spanA, { title: "Leading Span A", color: "#26a69a", offset: baseLength });
plot(spanB, { title: "Leading Span B", color: "#ef5350", offset: baseLength });
plot(close, { title: "Lagging Span", color: "#7c4dff", offset: -baseLength });
fill(spanA, spanB, { color: spanA.map((v, i) => v >= spanB[i] ? "#26a69a" : "#ef5350"), opacity: 0.12 });
  

Community discussion

0 comments

Loading…

No comments yet. Start the discussion.