Custom Ichimoku Indicator: All Five Lines Plus A Gate

Written by Dominic Walsh · Published · Last updated

The custom ichimoku indicator keeps the whole system on the chart. Tenkan, Kijun, both Senkou spans and Chikou all appear. The addition is a gate on the entry. A Tenkan crossing Kijun produces nothing on its own, because price also has to sit clear of the cloud.

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 Main price chart
Plots 7: Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, Chikou Span, BUY, SELL
Alerts popup, push notification, email, sound
Inputs 10

What the Custom Ichimoku Indicator draws on the chart

Tenkan-sen is the crimson line and Kijun-sen is the royal blue one.

Senkou Span A is lime green and Senkou Span B is tomato, forming the cloud.

Chikou Span is the dark orchid line displaced back through the chart.

BUY and SELL mark a gated cross, `ArrowOffsetPts` `30` from the candle.

  • Tenkan-sen: line, crimson, width 2
  • Kijun-sen: line, royal blue, width 2
  • Senkou Span A: line, lime green, width 1
  • Senkou Span B: line, tomato, width 1
  • Chikou Span: line, dark orchid, width 1
  • BUY: arrow, lime, width 2, arrow code 233
  • SELL: arrow, red, width 2, arrow code 234
Custom ichimoku indicator on EURUSD H1 with all five lines and gated crosses
Custom ichimoku indicator on EURUSD H1 with all five lines and gated crosses

How the Custom Ichimoku Indicator calculates its values

Reading the whole system

iIchimoku supplies all five components at `TenkanPeriod` `9`, `KijunPeriod` `26` and `SenkouSpanBPer` `52`. Taking every line from one call keeps them consistent with any other Ichimoku on the same chart.

The crossing test

The code reads Tenkan and Kijun for the current bar and the one before it. A buy needs Tenkan at or below Kijun previously and above it now. That pair of readings turns a state into an event.

The cloud gate

cloudTop takes the higher of the two spans and cloudBot the lower. A buy also needs the close above cloudTop. So a cross inside the cloud or on the wrong side of it produces nothing at all.

How to read the signals

A mark means the cross and the cloud position agreed on the same bar.

Crosses inside the cloud are common and the gate removes them.

Chikou sits well to the left, which is why the chart looks empty on the right of it.

Cloud thickness gives you a rough sense of how far price would have to travel.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` starts on and `EnablePopup` carries the text. `EnablePushNotify`, `EnableEmail` and `EnableSound` begin false. `SoundFile` picks the clip. The cross test reads two completed bars, and the guard allows one message per bar.

Every Custom Ichimoku Indicator input

Core settings

Setting What it does Default
TenkanPeriod Conversion line length, default `9`. 9
KijunPeriod Base line length, default `26`. 26
SenkouSpanBPer Length behind the second span, default `52`. 52

Display settings

Setting What it does Default
ArrowOffsetPts Mark distance from the candle in points, default `30`. 30

Alert settings

Setting What it does Default
EnableAlerts Master switch for the Tenkan cross alerts, default `true`. on
EnablePopup Terminal dialog on a gated cross, default `true`. on
EnablePushNotify Phone push on a gated cross, default `false`. off
EnableEmail Mail delivery on a gated cross, default `false`. off
EnableSound Sound playback on a gated cross, default `false`. off
SoundFile Wav clip for the cross alert, default `alert.wav`. alert.wav
Custom ichimoku indicator inputs: TenkanPeriod, KijunPeriod, SenkouSpanBPer, ArrowOffsetPts
Custom ichimoku indicator inputs: TenkanPeriod, KijunPeriod, SenkouSpanBPer, ArrowOffsetPts

Settings that fit your chart

The classic 9, 26 and 52 numbers come from daily charts. EURUSD H1 is the reference chart, where `SenkouSpanBPer` at `52` covers just over two days. On M5 the cloud shifts too fast to gate much. On H4 and daily the gate does real work and marks turn scarce.

When the Custom Ichimoku Indicator fails

The cloud is projected forward, so the gate compares price against a level set 26 bars ago.

A cross with price already far from the cloud arrives late in the move.

Five lines plus arrows is a busy chart, and the gate is easy to lose visually.

Copy the compiled Custom Ichimoku 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.

Related on forexmt4systems.com: Ichimoku Trend Strategy.

Background reading on the method behind the Custom Ichimoku Indicator: iichimoku (ICHIMOKU) at the MQL5 Documentation, ICHIMOKU Cloud at StockCharts ChartSchool.

Download the Custom Ichimoku Indicator for MT4 and MT5

The zip holds the compiled Custom Ichimoku 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.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does the Senkou Span A gate block?

Every Tenkan and Kijun cross that happens while price sits inside the cloud or on the wrong side of it. A buy needs the close above both spans. That single condition removes most of the crosses a plain Ichimoku would show.

Why does SenkouSpanBPer default to 52?

It is the original number, chosen when the system was built on daily candles. Fifty-two of those covers roughly a quarter. On EURUSD H1 the same setting spans two days, which still gives the slower span something meaningful to describe.

What is the Chikou Span plot showing?

The current close, displaced back through the chart by the base line length. Traders compare it against price from that period to judge whether the move is clean. It carries no part of the arrow logic here.

Does TenkanPeriod at 9 suit H1?

It works, though it was designed for daily bars. Nine H1 bars is barely a session, so the conversion line reacts quickly and crosses often. The cloud gate is what keeps the arrow count sensible at that speed.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Custom Ichimoku 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

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment