Skip to content
← Back to the research library
MQL5 SOURCE COLLECTION / Trend Following

Ichimoku Cross with ATR Exits

Trades Tenkan/Kijun crosses using daily ATR to set the stop and target distances.

MT5 / MQL5Original sourceUnverified source

H1 signals / D1 ATR · Published 28 October 2026

Source inspectionLimited static review
MetaEditor compilationNot performed
Backtest / live recordNot supplied

How the source is structured

  1. Read two completed H1 values of the Tenkan and Kijun lines.
  2. Buy on an upward cross and sell on a downward cross.
  3. Calculate exit distances from the previous daily ATR value.

Default inputs

As supplied; these are not optimized or recommended settings.
Volume0.1 lot
Tenkan / Kijun / Span B9 / 21 / 52
ATR periodD1 / 14
Stop / target ATR factors1.0 / 1.0
BEFORE YOU TEST

Source-review notes

These observations come from reading this uploaded version. They are not compiler output or a complete code audit. The download retains the source as supplied.

SOURCE LINES 19–23, 35–40

Indicator-handle validity and buffer-copy results are not checked before array access.

SOURCE LINES 45–54

There is no open-position guard or magic-number setup. The sell target is based on ask while the sell stop and entry use bid.

SOURCE LINES 35–54

Only the Tenkan/Kijun cross is used; the source does not implement a cloud-position filter.

Dependencies

Built-in Ichimoku and ATR indicators; MetaTrader 5 standard Trade library.

Source & attribution

The original filename includes 'Rene'; the source contains no author or license declaration.

Included in the Edge Quant source collection with existing notices preserved. Free download does not imply a new license grant.

Original filename: Ichimoku Rene.mq5
Encoding: UTF-8

Inspect the original source

The browser preview is decoded for reading; the download keeps the original file bytes.

Direct .mq5 file ↓
Expand full MQL5 source · 59 lines
#include <Trade/Trade.mqh>input double Lots = 0.1;input double AtrSLFactor = 1.0;input double AtrTpFactor = 1.0;input ENUM_TIMEFRAMES IchiTimeframe = PERIOD_H1;input int IchiTenkanSen = 9;input int IchiKijunSen = 21;input int IchiSenkouSpanB = 52;input ENUM_TIMEFRAMES AtrTimeframe = PERIOD_D1;input int AtrPeriods = 14;CTrade trade;int handleIchimoku, handleAtr;datetime timestamp;int OnInit(){   handleIchimoku = iIchimoku(_Symbol,IchiTimeframe,IchiTenkanSen,IchiKijunSen,IchiSenkouSpanB);   handleAtr = iATR(_Symbol,AtrTimeframe,AtrPeriods);      return(INIT_SUCCEEDED);}void OnDeinit(const int reason){}void OnTick(){   datetime time0 = iTime(_Symbol,IchiTimeframe,0);   if(time0 != timestamp){      timestamp = time0;            double tenkanSen[], kijunSen[];      CopyBuffer(handleIchimoku,TENKANSEN_LINE,1,2,tenkanSen);      CopyBuffer(handleIchimoku,KIJUNSEN_LINE,1,2,kijunSen);            double atr[];      CopyBuffer(handleAtr,MAIN_LINE,1,1,atr);            double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK);      double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);            if(tenkanSen[1] > kijunSen[1] && tenkanSen[0] <= kijunSen [0]){         double sl = ask - atr[0] * AtrSLFactor;         double tp = ask + atr[0] * AtrTpFactor;               trade.Buy(Lots,_Symbol,ask,sl,tp,"Ichi Buy");       }else if(tenkanSen[1] < kijunSen[1] && tenkanSen[0] > kijunSen[0]){            double sl = bid + atr[0] *AtrSLFactor;            double tp = ask - atr[0] *AtrTpFactor;                  trade.Sell(Lots,_Symbol,bid,sl,tp,"Ichi Sell");                             }   }}

SHA-256: 10d704c471cc81372a701fa87039ed53e1f53634c7b02ea4a6b9654c68a4247d

Educational source material, not investment advice. No profitability, execution quality or live-readiness claim is made for this upload.