# Ichimoku Kumo Breakout EA for MT5

> Free Ichimoku Expert Advisor: trades closes that break out of the Kumo cloud with Tenkan/Kijun confirmation, with a Kijun or ATR stop and R target.

## At a glance

- What it is: A free Expert Advisor for MetaTrader 5, written in MQL5.
- What it does: Free Ichimoku Expert Advisor: trades closes that break out of the Kumo cloud with Tenkan/Kijun confirmation, with a Kijun or ATR stop and R target.
- Shared by: Alex
- Licence: MIT
- Version: 1.0 (1 Dec 2026)
- Settings: 19 inputs
- Lab check: Compiled with MetaEditor build 6333 for MT5 on 1 Dec 2026: 0 errors, 0 warnings.
- Price: Free to download
- Page: https://hub.fxnook.com/ichimoku-kumo-breakout-ea-for-mt5
- Download (compiled): https://hub.fxnook.com/download/c605a8fc-33a0-4c23-8e65-43af90fe01d4/compiled
- Download (source): https://hub.fxnook.com/download/c605a8fc-33a0-4c23-8e65-43af90fe01d4/source

## About

**FXN Ichimoku Kumo Breakout** is a free, open-source Expert Advisor for MetaTrader 4 and MetaTrader 5 that trades closes out of the Ichimoku cloud. It calculates all Ichimoku lines itself, so the logic is identical on both platforms.

## How it works

- `Tenkan = (highest high + lowest low) / 2` over 9 bars, `Kijun` the same over 26 bars. `Span A = (Tenkan + Kijun) / 2` and `Span B` = midpoint of the last 52 bars, both shifted 26 bars forward to form the Kumo.
- **Buy** when a bar closes above the cloud top after closing at or below it, with Tenkan above Kijun and the close above Kijun.
- **Sell** is the mirror below the cloud bottom.
- **Stop loss**: **Beyond Kijun-sen** puts it at Kijun minus `buffer x ATR` (buys), moved out to `Min stop distance x ATR` if closer. **ATR multiple** uses `ATR x ATR stop` from entry.
- **Take profit** = entry plus `stop distance x R`; R = 0 disables it.
- **Lot size** (risk mode): `balance x risk % / money lost per lot at the stop`, rounded down to the lot step.

## Inputs

| Input | Default | What it does |
|---|---|---|
| Tenkan-sen period | 9 | Conversion line period. |
| Kijun-sen period | 26 | Base line period; also the cloud displacement. |
| Senkou Span B period | 52 | Period of the slow cloud edge. |
| Stop mode | Beyond Kijun-sen | Beyond Kijun-sen or ATR multiple. |
| Kijun stop buffer (x ATR) | 0.25 | Extra room beyond the Kijun-sen in Kijun mode. |
| Min stop distance (x ATR) | 0.5 | Kijun stops closer than this are moved out to it. |
| ATR period | 14 | Average True Range period. |
| ATR stop (x ATR) | 2.0 | Stop distance in ATR mode. |
| Take profit (R) | 2.0 | Target = stop distance times this; 0 = no take profit. |
| Use risk % sizing | true | true = lot from risk %; false = fixed lot. |
| Risk per trade (% of balance) | 1.0 | Balance share lost if the stop is hit. |
| Fixed lot | 0.10 | Lot used when risk sizing is off. |
| Magic number | 410105 | Identifies this EA's trades. |
| Max spread (points) | 30 | No entry above this spread; 0 = off. |
| Max slippage (points) | 10 | Allowed fill deviation. |
| Order comment | FXN IchimokuBreakout | Text saved on each order. |
| Use trading hours | false | Entries only inside the window; exits any time. |
| Start hour (0-23) | 7 | First hour with entries. |
| End hour (0-23) | 20 | Entries stop at this hour; may wrap past midnight. |

## How to use it

1. Copy `FXN_IchimokuBreakout.mq4` to `MQL4/Experts` (MT4) or `FXN_IchimokuBreakout.mq5` to `MQL5/Experts` (MT5); **File > Open Data Folder** shows where.
2. Refresh the Navigator, drag the EA onto a chart and turn on **AutoTrading** (MT4) or **Algo Trading** (MT5).
3. Suggested start: H4 or D1 on FX majors, gold or indices, standard 9/26/52, Kijun stop with a 0.25 ATR buffer, target 2R, risk 0.5-1 %.
4. Test in the Strategy Tester and on a demo account first.

## Good to know

- 9/26/52 dates from a six-day trading week; some traders use 20/60/120 on 24-hour markets.
- Breakouts can fail back into the cloud; in choppy markets the Kijun stop is hit often.
- Trades end at the stop or target; the Chikou span is not used.
- Closed-bar signals that do not repaint; one entry per bar and one trade per symbol and magic number. No martingale, grid or averaging down.
- Stops respect broker stop and freeze levels. If risk sizing gives less than the minimum lot, the trade is skipped and logged. On MT5 netting accounts it will not trade a symbol that already has another position.

Trading carries risk. Test on a demo account first; past results do not predict future results.

## Settings (inputs)

| Input | Type | Default | Note |
|---|---|---|---|
| InpTenkan | int | 9 | Tenkan-sen period |
| InpKijun | int | 26 | Kijun-sen period |
| InpSenkouB | int | 52 | Senkou Span B period |
| InpStopMode | ENUM_ICHI_STOP_MODE | ICHI_STOP_KIJUN | Stop mode |
| InpKijunBufferAtr | double | 0.25 | Kijun stop buffer (x ATR) |
| InpMinStopAtr | double | 0.5 | Min stop distance (x ATR) |
| InpAtrPeriod | int | 14 | ATR period |
| InpStopAtrMult | double | 2.0 | ATR stop (x ATR) |
| InpTargetR | double | 2.0 | Take profit (R) |
| InpUseRiskPercent | bool | true | Use risk % sizing |
| InpRiskPercent | double | 1.0 | Risk per trade (% of balance) |
| InpFixedLot | double | 0.10 | Fixed lot |
| InpMagic | ulong | 410105 | Magic number |
| InpMaxSpreadPoints | int | 30 | Max spread (points) |
| InpSlippagePoints | int | 10 | Max slippage (points) |
| InpOrderComment | string | FXN IchimokuBreakout | Order comment |
| InpUseTradingHours | bool | false | Use trading hours |
| InpStartHour | int | 7 | Start hour (0-23) |
| InpEndHour | int | 20 | End hour (0-23) |

Tags: ichimoku, kumo, cloud, breakout, kijun, trend, expert-advisor

Shared code is the author's work, not financial advice. Test on a demo account first.
