Ichimoku Cloud EA for MT5 — No Code
Can I build an Ichimoku cloud EA for MT5 without coding?
Yes. The Ichimoku cloud is one of the 47 indicator types in the MT5 Strategy Builder. Add it in Step 3 (Entry rules): price above the cloud for buy, price below it for sell, then exits and risk, then generate MQL5 in Code Generator. If you prefer to hand-code it, Tenkan-sen, Kijun-sen and the two Senkou spans are each a short highest-high/lowest-low average (outline below).
Disclosure: Educational guide — not financial advice.
Related guides: Ichimoku Indicator (academy) · MA Crossover EA — No Code · Build EA Without Coding · EA Strategy Library
What Is an Ichimoku Cloud EA?
An Ichimoku Cloud EA automates rules based on the Kumo (cloud) and price position:
| Signal | Rule (starter) |
|---|---|
| Buy | Price above cloud + bullish (green) cloud |
| Sell | Price below cloud + bearish (red) cloud |
Components: Tenkan-sen, Kijun-sen, Senkou Span A/B (cloud), Chikou Span — see Ichimoku academy guide.
Classic Ichimoku Settings and When It Works
| Parameter | Common default |
|---|---|
| Conversion line length (Tenkan) | 9 |
| Base line length (Kijun) | 26 |
| Leading span B length | 52 |
| Displacement | 26 |
| Timeframe | H1 or H4 |
Works best: Clear trends with price consistently on one side of the cloud.
Struggles in: Choppy ranges inside the cloud — frequent flip signals.
Ichimoku Logic in MQL5
Each Ichimoku line is a short highest-high/lowest-low average. MQL5's iIchimoku returns the Tenkan, Kijun and Senkou buffers:
// OnInit
ichiHandle = iIchimoku(_Symbol, PERIOD_H1, 9, 26, 52);
// OnTick, once per new bar — buffer indices per MQL5 docs
CopyBuffer(ichiHandle, 0, 1, 1, tenkan); // Tenkan-sen
CopyBuffer(ichiHandle, 1, 1, 1, kijun); // Kijun-sen
CopyBuffer(ichiHandle, 2, 1, 1, senkouA); // Senkou Span A
CopyBuffer(ichiHandle, 3, 1, 1, senkouB); // Senkou Span B
bool aboveCloud = close[1] > MathMax(senkouA[0], senkouB[0]);
bool belowCloud = close[1] < MathMin(senkouA[0], senkouB[0]);
Remember the cloud is displaced forward by the Displacement value (26 bars by default) — read the buffer at the correct shift for the bar you are testing against.
Ichimoku in the Builder
In Step 3 (Entry rules) add the Ichimoku cloud indicator. Its settings are the Conversion line length (Tenkan) (default 9), the Base line length (Kijun) (26), the Leading span B length (52) and the Displacement (26, under More settings). Write the buy rule as price above the cloud and the sell rule as price below it, and optionally add a Step 4 Market sessions filter. For a simpler trend idea without a cloud, see MA Crossover EA — No Code.
Note: a plain crossover has no forward-projected cloud and no Chikou lagging-span confirmation. It is a simpler trend idea, not an Ichimoku equivalent.
Export, Compile, and Backtest
Compile your .mq5 (hand-written, or generated in Code Generator) with F7 → Strategy Tester Every tick.
Improvements: Filters and Risk
| Issue | Lever |
|---|---|
| Whipsaw in ranges | Use longer Ichimoku lengths, or add a Step 4 filter on your own ATR condition |
| Late entries | Add a higher timeframe in Step 2 and read the trend from it |
| Session-dependent noise | Add a Step 4 Market sessions filter |
The Ichimoku cloud with line cross: history and rules
Who and when: Goichi Hosoda, a Japanese journalist; published in 1969. The only library record found is of a 1975 printing.
Ichimoku Kinko Hyo, the "one look equilibrium chart", was developed by the Japanese journalist Goichi Hosoda and published in 1969. It puts several lines on the chart. The conversion line is the midpoint of the high-low range of the last 9 bars; the base line is the same over 26 bars. Two further lines, drawn ahead of the price, form the cloud.
The reading used here has two parts. The trend is up when the price is above the cloud. Inside that trend, a buy signal comes when the conversion line crosses above the base line. The sale is the mirror: the price below the cloud and the conversion line crossing below the base line.
The rule as the source states it
Settings 9, 26, 52. The trend is up when prices are above the cloud. A bullish signal comes when the conversion line crosses above the base line. [1] [2]
Our version
Ichimoku (9, 26, 52, shift 26) on daily bars of a currency pair. Buy when the close is above the top of the cloud and the conversion line crosses above the base line. Sell short on the mirror. An opposite signal closes the trade and reverses it.
How ours differs
- The lagging line is not used.
- "Above the cloud" is read on the same bar as the cross.
- Like every library file, ours also adds the builder's default stop, position size and account limits (Steps 5 and 6). You can change them in the form.
Needs the Starter plan or higher. Open in the builder →
Being well known says nothing about how a strategy will do. Test it on your own data.
Next Steps
Before you code the full cloud: start with just the Tenkan/Kijun relationship on a chart and confirm your MQL5 reads match what you see visually, before adding the Senkou spans and Chikou span.
References: Investopedia — Ichimoku [3] · MetaTrader 5 Strategy Tester [4].

