Ichimoku Cloud EA MT5 — No Code

Ichimoku cloud EA: classic 9/26/52 settings, how to build a cloud rule in the Strategy Builder, and the iIchimoku logic in MQL5.

📖 6 min read

📝 1,110 words

🏷️ MQL5 and Expert Advisors

Share this article:

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:

SignalRule (starter)
BuyPrice above cloud + bullish (green) cloud
SellPrice 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

ParameterCommon default
Conversion line length (Tenkan)9
Base line length (Kijun)26
Leading span B length52
Displacement26
TimeframeH1 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

IssueLever
Whipsaw in rangesUse longer Ichimoku lengths, or add a Step 4 filter on your own ATR condition
Late entriesAdd a higher timeframe in Step 2 and read the trend from it
Session-dependent noiseAdd 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].

Frequently Asked Questions

Yes. The Ichimoku cloud is one of the 47 indicator types in the MT5 Strategy Builder. Add it in Step 3 (Entry rules) and write a rule such as price above the cloud for buy and below it for sell. Then set exits and risk and generate MQL5 in Code Generator. You can also code the Tenkan-sen, Kijun-sen and Senkou spans yourself in MQL5.

Conversion line length (Tenkan) 9, Base line length (Kijun) 26, Leading span B length 52 and Displacement 26 are Goichi Hosoda's original values, still the most common defaults on H1 and H4.

No — it is a different system. The cloud is a projected band built from four separate lines with built-in forward displacement; a two-line EMA crossover has no equivalent projection or cloud thickness. Treat it as a substitute trend idea, not an equivalent rule.

No. Educational guide only. Cloud-based rules lag in fast reversals, same as most trend-following systems. Backtest and Demo are required before any live use.

Read /academy/indicators/ichimoku for Tenkan, Kijun, Senkou spans and Chikou, then use the MQL5 outline below as a starting point for your own implementation.

Goichi Hosoda, a Japanese journalist; published in 1969. The only library record found is of a 1975 printing. 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. Being well known says nothing about how a strategy will do. Test it on your own data.

References

  1. StockCharts ChartSchool. Ichimoku Cloud. https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-overlays/ichimoku-cloud
  2. National Diet Library of Japan. catalog record of a 1975 printing. https://ndlsearch.ndl.go.jp/books/R100000002-I000001384184
  3. Investopedia. Ichimoku Kinko Hyo: Understanding Its 5 Key Components. https://www.investopedia.com/terms/i/ichimokuchart.asp
  4. MetaQuotes. MetaTrader 5 Built-in Trading Strategy Tester. https://www.metatrader5.com/en/automated-trading/strategy-tester