Reading an Ichimoku cloud takes practice. The ichimoku trend indicator does that reading for you and reports the answer as a number. Price above the cloud gives plus one, below gives minus one, and inside gives zero. The result plots as a stepped line in its own pane, which makes the current state readable at a glance and easy to check across a long history.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Separate window (levels 1 / 0 / -1) |
| Plots | 3: Trend, BuyArrow, SellArrow |
| Alerts | popup |
| Inputs | 5 |
What the Ichimoku trend Indicator draws on the chart
Trend is a dodger blue stepped line in a separate window, sitting at 1, 0 or minus 1.
Level lines at those three values make the state readable without hovering.
BuyArrow and SellArrow mark the bars where the state changed.
A chart label, named by `InpLabelTag`, carries the current reading as text.
- Trend: line, dodger blue, width 2
- BuyArrow: arrow, lime, width 2, arrow code 233
- SellArrow: arrow, red, width 2, arrow code 234

How the Ichimoku trend Indicator calculates its values
Reading the cloud at its proper offset
spanA and spanB come from iIchimoku using MODE_SENKOUSPANA and MODE_SENKOUSPANB, both requested at i + `InpKijun`. That shift matters. Ichimoku plots the cloud forward by the Kijun period, so reading it at the raw index would compare price against a cloud belonging to a different bar.
Sorting the cloud into a top and a bottom
cloudTop takes MathMax(spanA, spanB) and cloudBot takes MathMin. The two spans swap places whenever the cloud flips, so sorting them removes the ambiguity. Whichever span sits higher becomes the ceiling for this test.
Collapsing position into a state
state takes 1.0 when close[i] clears cloudTop, and minus 1.0 when it drops below cloudBot. Price between the two leaves the state alone, which is why the line steps rather than dropping to zero on every touch. Trend[i] stores it, prev reads the previous bar, and a difference between them writes an arrow.
How to read the signals
The line has only three possible heights, so a step is the entire event.
Long flat stretches at plus one or minus one are the normal picture during a trend.
Because the state persists inside the cloud, the line does not flicker while price consolidates there.
Arrows appear on the price chart at the bar where the state changed, offset ten points from the candle.
Alert channels in this build: popup, one message per closed bar.
One channel exists, a terminal popup, driven by `InpAlerts` whose comment names a trend flip specifically. The message therefore follows a state change rather than every bar spent in a state, and the guard permits one per closed bar.
Every Ichimoku trend Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpTenkan |
Tenkan-sen period. Tenkan-sen period, default `9`, feeding Senkou Span A. | 9 |
InpKijun |
Kijun-sen period. Kijun-sen period, default `26`. It sets both part of Span A and the forward shift the cloud is read at. | 26 |
InpSenkou |
Senkou span B period. Senkou Span B period, default `52`, the slowest input and the one driving the warmup. | 52 |
Display settings
| Setting | What it does | Default |
|---|---|---|
InpLabelTag |
Chart label name. Names the chart label object, default `”ITrend”`. Change it only if another tool uses the same name. | ITrend |
Alert settings
| Setting | What it does | Default |
|---|---|---|
InpAlerts |
Enable alert on trend flip. | on |

Settings that fit your chart
Goichi Hosoda built Ichimoku around daily candles, and it still reads best on higher timeframes. EURUSD H1 is the reference chart, where the 52-period span covers about two days. On M5 the cloud shifts too fast for the state to mean much. On H4 and daily each state change marks a genuine shift, closer to how the system was meant to work.
When the Ichimoku trend Indicator fails
Cloud position is a slow read. By the time price clears the cloud, a good part of the move has happened.
The state persists while price sits inside the cloud, so a long consolidation keeps reporting the old direction.
A long warmup means the tool needs plenty of history. On a freshly opened chart the line never starts.
Copy the compiled Ichimoku trend Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Download the Ichimoku trend Indicator for MT4 and MT5
The zip holds the compiled Ichimoku trend Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
Why request the spans at i plus InpKijun?
Because Ichimoku plots the cloud forward. It displaces Senkou Span A and B ahead by the Kijun period, so the cloud you see above a candle came from earlier data. Adding `InpKijun` to the index fetches the span values that actually belong to the bar under test.
What happens to the Trend line while price sits inside the cloud?
It holds whatever state it had. state only changes when close clears cloudTop or drops under cloudBot, so a bar finishing between the two leaves the previous reading alone. That is why the line steps between three levels instead of dropping to zero every time price enters the cloud.
Does InpTenkan matter if the Tenkan line is never drawn?
Yes. Senkou Span A is the average of the Tenkan and Kijun lines, so `InpTenkan` feeds directly into the upper or lower cloud boundary. Changing it moves the cloud, which changes where the state flips, even though the Tenkan itself never appears.
Why does the Trend plot live in a separate window?
Because it holds a number between minus one and one, not a price. Plotting it on the chart would squash the candles. The pane gives it a scale of its own with level lines at the three values, and the arrows still land on the price chart where the change happened.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Ichimoku trend Indicator as one input. Always backtest before trading live.
Category: this is part of our Trend collection. Also, truly, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see Capital asset pricing model on Wikipedia.
- For broader market context, see the MetaTrader 4 user guide at MetaTrader.
