OPEN-SOURCE SCRIPT
Edo Ichimoku State

Edo Ichimoku State — Five-State Structural Classifier for Ichimoku Kinko Hyo

Ichimoku Kinko Hyo is one of the most complete systems available for reading market structure at a single glance. Its name means roughly "one-glance equilibrium chart", yet in practice that single glance is anything but simple: a reader has to combine the position of price relative to the cloud, the slope of the cloud itself, the relationship between Tenkan and Kijun, and the position of the Chikou Span relative to past price before deciding whether the context is a confirmed trend, a directional bias, a transition, or no direction at all.
Edo Ichimoku State keeps that full engine intact and does the synthesis for you. It calculates the five classical Ichimoku lines with their original 9 / 26 / 52 periods, evaluates four independent conditions bar by bar, and returns a single market state, a dual Bull / Bear score, and a summary panel listing the conditions that support the reading. The aim is to turn a visually demanding but technically powerful system into a direct reading surface, without simplifying or discarding any of its original components.
WHAT IT DOES (AND WHAT IT IS NOT)
The indicator is a complete implementation of the Ichimoku system: its five lines, the cloud projected forward by the classical displacement, a discrete classification into five states, a 0-to-4 Bull / Bear score, an optional state-colored background, and a corner panel. By default only the cloud and the colored background are shown, keeping the chart clean; every other line can be turned on individually for those who want the full detail.
It is not a closed trading system or an automatic entry/exit signal generator. It does not predict specific highs or lows, nor does it replace risk management or the trader's own judgment. It is also not a simplified Ichimoku: all five original components are present and calculated with the canonical periods.
THE FIVE LINES
Tenkan-sen (Conversion Line): the midpoint of the last 9 periods' range, (highest high + lowest low) / 2. It is the most reactive line and the first to turn on a reversal.
Kijun-sen (Base Line): the midpoint of the last 26 periods' range. It acts as an intermediate structural reference and as classical dynamic support/resistance.
Senkou Span A (Leading Span A): (Tenkan + Kijun) / 2, displaced 26 bars forward. The first edge of the cloud; it reacts faster than Senkou B to trend changes.
Senkou Span B (Leading Span B): the midpoint of the last 52 periods' range, displaced 26 bars forward. The second, much more stable edge of the cloud; it defines the structural floor or ceiling.
Chikou Span (Lagging Line): the current close, displaced 26 bars backward. It compares current price to the price 26 bars ago and provides historical confirmation.
THE CLOUD (KUMO)
The cloud is the most characteristic element of Ichimoku and the only line shown enabled by default. It is the fill between the two Senkou Spans projected 26 bars forward. When Senkou A is above Senkou B the cloud is bullish and painted in a soft teal green; when Senkou A is below Senkou B the cloud is bearish and painted in a soft coral red. A crossover of the two spans flips the cloud color entirely, an event called a Cloud Flip.
Reading the Kumo is straightforward: price above the cloud is a bullish structural bias with the cloud acting as dynamic support; price below the cloud is a bearish bias with the cloud acting as dynamic resistance; price inside the cloud means no clear direction, and the indicator classifies that situation as Undefined. The thickness of the cloud is proportional to the strength of that support or resistance: a thin cloud breaks easily, a thick one is rarely crossed in a single move. Because the cloud is projected 26 bars forward, it also lets you anticipate the structural support or resistance price will face in the immediate future.
THE FIVE-STATE CLASSIFICATION
The market state is reduced to one of five discrete configurations, ordered from maximum bullish strength to maximum bearish strength:
Confirmed Up — all four bullish conditions active simultaneously.
Bias Up — at least two bullish conditions active and dominating over the bearish ones.
Undefined — price inside the cloud, or a balance between bullish and bearish conditions.
Bias Down — at least two bearish conditions active and dominating over the bullish ones.
Confirmed Down — all four bearish conditions active simultaneously.
The state is built from four independent conditions evaluated on every bar. Price vs Cloud checks whether price is above the cloud (bullish) or below it (bearish); if price is inside the cloud, neither side counts and the state is forced directly to Undefined, following the original Ichimoku logic that there is no operational direction inside the Kumo. Cloud Bias checks whether Senkou A is above or below Senkou B, measuring the projected direction of the cloud. TK vs KJ checks whether Tenkan-sen is above or below Kijun-sen, measuring recent momentum. Chikou Free checks whether current price is above or below the price 26 bars ago, measuring historical confirmation.
BULL SCORE AND BEAR SCORE
Alongside the discrete state, the indicator publishes two complementary scores. The Bull Score counts how many bullish conditions are active on the current bar, out of four; the Bear Score counts how many bearish conditions are active, built from the inverse of each bullish condition. The two are not strictly complementary: both can sit at intermediate values at the same time, for example Bull 2/4 and Bear 2/4 when the cloud is mixed or price is right on its edge. The discrete state resolves which reading prevails. The scores are especially useful for comparing bars within the same state: a Bias Up with Bull 3/4 and Bear 1/4 is more solid than a Bias Up with Bull 2/4 and Bear 2/4, even though both carry the same label.
INFORMATION PANEL
A summary panel sits in one corner of the chart and condenses the Ichimoku state on the most recent closed bar into seven rows. The first row shows the current state label together with its duration in bars (for example 21b), which tells you how long the market has held the same configuration. The next four rows show the individual conditions: Price vs Cloud (Above / Inside / Below), Cloud Bias (Bullish / Bearish), TK vs KJ (TK greater or less than KJ), and Chikou Free (Above / Below / Level). The last two rows show the Bull Score and Bear Score as N / 4. Panel position (any of the four corners), size (Small / Medium) and theme (Dark / Light) are all configurable.
HOW TO READ IT
The state and the score give an immediate reading, but the indicator gains depth when combined with recent transition history. A clean bullish activation typically runs Undefined to Bias Up to Confirmed Up over a few bars, with a Cloud Flip from bearish to bullish and a Bull Score climbing toward 4/4. Bullish exhaustion often shows a long-lived Confirmed Up whose Bull Score oscillates between 3/4 and 4/4 without settling. A drop into the cloud turns the state to Undefined and tends to resolve either as a bounce on Senkou A back into Bias Up, a full crossing that exits below into Bias Down, or sideways action inside the Kumo. A bearish confirmation sees price break the cloud downward while Cloud Bias turns bearish, TK falls under KJ and Chikou stays below historical price, moving the state Undefined to Bias Down to Confirmed Down. The logic is ticker-agnostic and works the same on stocks, indices, crypto, forex and commodities, provided the asset has enough liquidity for stable highs/lows.
ALERTS
The indicator publishes ten native alert conditions, all configured from TradingView's standard alert dialog by picking the event from the dropdown. Five state alerts fire when the state newly enters Confirmed Up, Confirmed Down, Bias Up, Bias Down or Undefined. Two price-vs-cloud alerts fire when the close crosses above or below the cloud. Two Cloud Flip alerts fire when Senkou A crosses above Senkou B (Cloud Flip Bull) or below it (Cloud Flip Bear). Two TK/KJ cross alerts fire when Tenkan crosses above or below Kijun. State-change alerts fire on the exact bar the new state first appears; to avoid intrabar triggers, set the alert to Once Per Bar Close.
CONFIGURATION
Ichimoku periods default to the canonical 9 (Tenkan), 26 (Kijun) and 52 (Senkou Span B), with both the forward cloud displacement and the backward Chikou displacement at 26; these match the original system and changing them is only recommended for specific studies. The Lines section toggles Tenkan-sen, Kijun-sen and Chikou Span (hidden by default) and the Kumo fill (enabled), with a Cloud Opacity from 40 to 95. The State section enables a state-colored background (on by default, opacity 70 to 98) and an optional Paint Candles by State mode. The five state colors are each customizable, and the panel can be shown or hidden, repositioned to any corner, and sized Small or Medium.
OPEN SOURCE
Edo Ichimoku State is published on TradingView as a free, open-source indicator. Any user with an active account can add it to their charts at no cost and use it on whatever timeframes and assets they consider appropriate. You are welcome to study the code and learn from how the four conditions are formalized into the five-state classification.
This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.
Ichimoku Kinko Hyo is one of the most complete systems available for reading market structure at a single glance. Its name means roughly "one-glance equilibrium chart", yet in practice that single glance is anything but simple: a reader has to combine the position of price relative to the cloud, the slope of the cloud itself, the relationship between Tenkan and Kijun, and the position of the Chikou Span relative to past price before deciding whether the context is a confirmed trend, a directional bias, a transition, or no direction at all.
Edo Ichimoku State keeps that full engine intact and does the synthesis for you. It calculates the five classical Ichimoku lines with their original 9 / 26 / 52 periods, evaluates four independent conditions bar by bar, and returns a single market state, a dual Bull / Bear score, and a summary panel listing the conditions that support the reading. The aim is to turn a visually demanding but technically powerful system into a direct reading surface, without simplifying or discarding any of its original components.
WHAT IT DOES (AND WHAT IT IS NOT)
The indicator is a complete implementation of the Ichimoku system: its five lines, the cloud projected forward by the classical displacement, a discrete classification into five states, a 0-to-4 Bull / Bear score, an optional state-colored background, and a corner panel. By default only the cloud and the colored background are shown, keeping the chart clean; every other line can be turned on individually for those who want the full detail.
It is not a closed trading system or an automatic entry/exit signal generator. It does not predict specific highs or lows, nor does it replace risk management or the trader's own judgment. It is also not a simplified Ichimoku: all five original components are present and calculated with the canonical periods.
THE FIVE LINES
Tenkan-sen (Conversion Line): the midpoint of the last 9 periods' range, (highest high + lowest low) / 2. It is the most reactive line and the first to turn on a reversal.
Kijun-sen (Base Line): the midpoint of the last 26 periods' range. It acts as an intermediate structural reference and as classical dynamic support/resistance.
Senkou Span A (Leading Span A): (Tenkan + Kijun) / 2, displaced 26 bars forward. The first edge of the cloud; it reacts faster than Senkou B to trend changes.
Senkou Span B (Leading Span B): the midpoint of the last 52 periods' range, displaced 26 bars forward. The second, much more stable edge of the cloud; it defines the structural floor or ceiling.
Chikou Span (Lagging Line): the current close, displaced 26 bars backward. It compares current price to the price 26 bars ago and provides historical confirmation.
THE CLOUD (KUMO)
The cloud is the most characteristic element of Ichimoku and the only line shown enabled by default. It is the fill between the two Senkou Spans projected 26 bars forward. When Senkou A is above Senkou B the cloud is bullish and painted in a soft teal green; when Senkou A is below Senkou B the cloud is bearish and painted in a soft coral red. A crossover of the two spans flips the cloud color entirely, an event called a Cloud Flip.
Reading the Kumo is straightforward: price above the cloud is a bullish structural bias with the cloud acting as dynamic support; price below the cloud is a bearish bias with the cloud acting as dynamic resistance; price inside the cloud means no clear direction, and the indicator classifies that situation as Undefined. The thickness of the cloud is proportional to the strength of that support or resistance: a thin cloud breaks easily, a thick one is rarely crossed in a single move. Because the cloud is projected 26 bars forward, it also lets you anticipate the structural support or resistance price will face in the immediate future.
THE FIVE-STATE CLASSIFICATION
The market state is reduced to one of five discrete configurations, ordered from maximum bullish strength to maximum bearish strength:
Confirmed Up — all four bullish conditions active simultaneously.
Bias Up — at least two bullish conditions active and dominating over the bearish ones.
Undefined — price inside the cloud, or a balance between bullish and bearish conditions.
Bias Down — at least two bearish conditions active and dominating over the bullish ones.
Confirmed Down — all four bearish conditions active simultaneously.
The state is built from four independent conditions evaluated on every bar. Price vs Cloud checks whether price is above the cloud (bullish) or below it (bearish); if price is inside the cloud, neither side counts and the state is forced directly to Undefined, following the original Ichimoku logic that there is no operational direction inside the Kumo. Cloud Bias checks whether Senkou A is above or below Senkou B, measuring the projected direction of the cloud. TK vs KJ checks whether Tenkan-sen is above or below Kijun-sen, measuring recent momentum. Chikou Free checks whether current price is above or below the price 26 bars ago, measuring historical confirmation.
BULL SCORE AND BEAR SCORE
Alongside the discrete state, the indicator publishes two complementary scores. The Bull Score counts how many bullish conditions are active on the current bar, out of four; the Bear Score counts how many bearish conditions are active, built from the inverse of each bullish condition. The two are not strictly complementary: both can sit at intermediate values at the same time, for example Bull 2/4 and Bear 2/4 when the cloud is mixed or price is right on its edge. The discrete state resolves which reading prevails. The scores are especially useful for comparing bars within the same state: a Bias Up with Bull 3/4 and Bear 1/4 is more solid than a Bias Up with Bull 2/4 and Bear 2/4, even though both carry the same label.
INFORMATION PANEL
A summary panel sits in one corner of the chart and condenses the Ichimoku state on the most recent closed bar into seven rows. The first row shows the current state label together with its duration in bars (for example 21b), which tells you how long the market has held the same configuration. The next four rows show the individual conditions: Price vs Cloud (Above / Inside / Below), Cloud Bias (Bullish / Bearish), TK vs KJ (TK greater or less than KJ), and Chikou Free (Above / Below / Level). The last two rows show the Bull Score and Bear Score as N / 4. Panel position (any of the four corners), size (Small / Medium) and theme (Dark / Light) are all configurable.
HOW TO READ IT
The state and the score give an immediate reading, but the indicator gains depth when combined with recent transition history. A clean bullish activation typically runs Undefined to Bias Up to Confirmed Up over a few bars, with a Cloud Flip from bearish to bullish and a Bull Score climbing toward 4/4. Bullish exhaustion often shows a long-lived Confirmed Up whose Bull Score oscillates between 3/4 and 4/4 without settling. A drop into the cloud turns the state to Undefined and tends to resolve either as a bounce on Senkou A back into Bias Up, a full crossing that exits below into Bias Down, or sideways action inside the Kumo. A bearish confirmation sees price break the cloud downward while Cloud Bias turns bearish, TK falls under KJ and Chikou stays below historical price, moving the state Undefined to Bias Down to Confirmed Down. The logic is ticker-agnostic and works the same on stocks, indices, crypto, forex and commodities, provided the asset has enough liquidity for stable highs/lows.
ALERTS
The indicator publishes ten native alert conditions, all configured from TradingView's standard alert dialog by picking the event from the dropdown. Five state alerts fire when the state newly enters Confirmed Up, Confirmed Down, Bias Up, Bias Down or Undefined. Two price-vs-cloud alerts fire when the close crosses above or below the cloud. Two Cloud Flip alerts fire when Senkou A crosses above Senkou B (Cloud Flip Bull) or below it (Cloud Flip Bear). Two TK/KJ cross alerts fire when Tenkan crosses above or below Kijun. State-change alerts fire on the exact bar the new state first appears; to avoid intrabar triggers, set the alert to Once Per Bar Close.
CONFIGURATION
Ichimoku periods default to the canonical 9 (Tenkan), 26 (Kijun) and 52 (Senkou Span B), with both the forward cloud displacement and the backward Chikou displacement at 26; these match the original system and changing them is only recommended for specific studies. The Lines section toggles Tenkan-sen, Kijun-sen and Chikou Span (hidden by default) and the Kumo fill (enabled), with a Cloud Opacity from 40 to 95. The State section enables a state-colored background (on by default, opacity 70 to 98) and an optional Paint Candles by State mode. The five state colors are each customizable, and the panel can be shown or hidden, repositioned to any corner, and sized Small or Medium.
OPEN SOURCE
Edo Ichimoku State is published on TradingView as a free, open-source indicator. Any user with an active account can add it to their charts at no cost and use it on whatever timeframes and assets they consider appropriate. You are welcome to study the code and learn from how the four conditions are formalized into the five-state classification.
This indicator is a technical analysis tool for educational and informational purposes only. It does not generate automatic buy or sell signals and should not be considered financial advice. Trading financial markets involves significant risk of capital loss. Past performance does not guarantee future results. Always use proper risk management.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
EdoLab Markets – Precision Trading Tools
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
EdoLab Markets – Precision Trading Tools
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
Get Exclusive Indicators:
edolab.io
All content provided is for informational and educational purposes only. Past performance does not guarantee future results.
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。