OPEN-SOURCE SCRIPT
Zaktualizowano

Ichimoku Kinko Hyo

1 358
Ichimoku Kinkō Hyō (IKH) — 一目均衡表

Ichimoku Kinkō Hyō is a complete Japanese charting system developed by Goichi Hosoda and his team in the late 1930s. It was designed to visualize market structure at a glance: trend direction, momentum, and key support/resistance zones.

This implementation preserves the classic Ichimoku structure while adding modern usability features. It is built for traders who want clean structure and beginner-friendly visuals with detailed tooltips. In addition to the traditional system, this version optionally includes scenario projections and historical flat level detection.

-----------------------------------------------------------------------------------------------

Ichimoku calculation reminder (5 key lines)

• Tenkan-sen (転換線 / Conversion Line)
Short-term equilibrium (fast)
Midpoint of the highest high and lowest low over the last 9 periods

• Kijun-sen (基準線 / Base Line)
Medium-term equilibrium (slow)
Midpoint of the highest high and lowest low over the last 26 periods

• Senkou Span A (先行スパンA / Leading Span A)
Forward “average equilibrium” (faster cloud boundary)
Average of Tenkan-sen and Kijun-sen, plotted forward by the displacement (default 26)

• Senkou Span B (先行スパンB / Leading Span B)
Long-term equilibrium (slower cloud boundary)
Midpoint of the highest high and lowest low over the last 52 periods, plotted forward by the
displacement

• Chikou Span (遅行スパン / Lagging Span)
Confirmation line (price vs past context)
The closing price plotted backward by the displacement

-----------------------------------------------------------------------------------------------

Key Features

Selectable Calculation Timeframe
Choose the timeframe used for Ichimoku calculations (or select “Chart” to use the current chart timeframe).

Inputs-First Design
Line colors defined in Inputs are used consistently across:
• Plots
• Labels
• Projection segments
• Flat levels

Flexible Labelling (Optional)
Supports customizable labels for Ichimoku lines.
• Japanese (Romanized) or English terminology
• Full or Short names

Romanized Japanese:
• Tenkan-sen → Tk
• Kijun-sen → Kj
• Senkou Span A → SSA
• Senkou Span B → SSB
• Chikou Span → Ck

English:
• Conversion line → Conv
• Base line → Base
• Lead line A → Lead A
• Lead line B → Lead B
• Lagging Span → Ls

Additional options:
• “Label + text” or “Text only”
• Optional timeframe tag
• Optional value display
• Per-line custom label text
• Hide any label using OFF or -

-----------------------------------------------------------------------------------------------

Scenario Projections — “No New High / Low” (Optional)

Conditional forward segments for:
• Tenkan-sen (up to 5 steps)
• Kijun-sen (up to 13 steps)
• Senkou Span A (up to 10 steps)
• Senkou Span B (up to 20 steps)
This is a scenario tool — not a prediction. It assumes upcoming bars do not create new highs or lows beyond the current lookback window.

Example:
For a Kijun-sen lookback of 26
+1 segment uses the last 25 bars
+2 uses the last 24 bars
+3 uses the last 23 bars
…and so on.

-----------------------------------------------------------------------------------------------

Flat Levels — Past Equilibrium Shelves (Optional)

Flat levels are historical horizontal “shelves” where an Ichimoku line remained unchanged for several consecutive bars. These shelves often act as future support or resistance because they represent prior equilibrium zones.

Detects flat segments on selected lines:
• Tenkan-sen
• Kijun-sen
• Senkou Span A
• Senkou Span B
A flat is confirmed when the line remains identical for at least Min flat length bars.

The script then:
• Displays up to Max levels, selected by proximity to the current price
• Draws horizontal rays from the flat’s ending point and extends them rightward

Flat Level Options
• Show flat levels (master on/off)
• Select which lines generate levels
• Min flat length (bars)
• Lookback window (bars)
• Max levels to display
• Ray style / thickness

Color mode:
• By line color
• Support / Resistance (levels below price = support, above price = resistance)

Flat Labels (Optional)
Flat levels can display right-side labels using the same labeling system as the Ichimoku lines, including:
• Language + length
• Optional timeframe tag
• Optional value display
• “Label + text” or “Text only”
• Shared far-right offset for clean alignment

-----------------------------------------------------------------------------------------------
Example of an alternative chart layout
snapshot
-----------------------------------------------------------------------------------------------

Notes / Disclaimer
• Projections and flat levels are analytical tools, not forecasts.
• No trading signal is guaranteed. Always manage risk appropriately.
• This script uses Pine Script® version 6.

-----------------------------------------------------------------------------------------------

Credit
• Thanks to NgheTrader for inspiration regarding projection / future-line concepts.
• Thanks to the TradingView team for the platform and charting infrastructure.
Informacje o Wersji
What is new?

Unified Label System
Labels are now fully modular and centralised:
Show:
  • Ichimoku labels only
  • Flat level labels only
  • Both or none

Independent control for:
  • Hover tooltips
  • Timeframe display
  • Values
  • Distance from price

Separate display modes:
  • Ichimoku labels
  • Flat level labels


Switch between presets visual styles:
  • Conventional Ichimoku colors
  • Neutral (clean structure focus)
  • Dark Theme (optimised for dark charts)
  • Blue / Green monochrome styles
  • Custom (fully manual)


Hover Tooltips
Labels can now display detailed contextual information on hover:
For Ichimoku lines:
  • Full line name
  • Timeframe
  • Value
  • Distance from price
  • Status: Rising / Falling / Flat (with duration)

For flat levels:
  • Source line(s)
  • Timeframe
  • Exact value
  • Distance
  • Number of bars forming the flat


Advanced Value & Distance Formatting
Full control over numerical display:
Value decimals:
Auto (adaptive)
Manual
Distance display:
%
Pips (Forex)
Points
Auto (market-aware)
Distance decimals:
Auto or manual

Flat Levels
1. Level Selection Mode
Nearest levels (previous behaviour)
Balanced support/resistance (NEW)

2. Multi-Line Confluence Detection (NEW)
When multiple Ichimoku lines share the same level:
They are merged into a single level
Label reflects combined sources:
Example: Kijun + SSB flat

Projected lines
updated limits for cleaner alignment and consistency
Kijun from 13 to 10
SSB from 20 to 10
Informacje o Wersji
Chart upated

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.