Discussion of article "Learn how to design a trading system by Ichimoku"

 

New article Learn how to design a trading system by Ichimoku has been published:

Here is a new article in our series about how to design a trading system b the most popular indicators, we will talk about the Ichimoku indicator in detail and how to design a trading system by this indicator.

In this part, we will create a blueprint for each strategy, I consider this step the most important step in our mission to create a trading system as it will help us to design a step-by-step blueprint that will help us to understand what we want to do exactly.

  • Strategy one: Ichimoku trend identifier:

Based on this strategy, we need to create a trading system that is able to check the values of closing prices, Senkou Span A, and Senkou span B continuously. We need the trading system to make a comparison between these values to decide which one is bigger or smaller to decide if there is an uptrend or downtrend and appear as a comment on the chart with values of the closing price and Ichimoku lines. If the closing price is greater than span B and the closing price is greater than span A, then the trend is up. If the closing price is lower than span B and the closing price is lower than span A, then the trend is down.

Ichimoku trend identifier blueprint

Author: Mohamed Abdelmaaboud

 
This is good presentation, I liked it
 
ApostleT #:
This is good presentation, I liked it
Thanks for your comment
 
Very good and useful lesson.
Thank you
 
I think it's better to combine come described strategies in one in order to make trading signals stronger.
 

Excellent article - only one minor issue is that I got memory leaks with the sample code 


I found by deleting the object in DeInit() fixed this

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   delete Ichimoku;
  }
 
hi all, help me to bugging mql5:
Files:
trendtang.mq5  3 kb
 

 my mind :

draw spanB limegreen when close > past clouds and close > past tenkansen, close > past kijunsen and close > Present clouds, spanA > spanB :


#include <Indicators/Trend.mqh>

CiIchimoku*Ichimoku;

//--- indicator settings

#property indicator_chart_window

#property indicator_buffers 9

#property indicator_plots   1

#property indicator_type1   DRAW_LINE

#property indicator_color1  LimeGreen

#property indicator_width1  2


   double sp1tl[];

   double sp2tl[];

   double trendtang[];

   double tenqk[];

   double kijqk[];

   double sp1ht[];

   double sp2ht[];

   double sp1qk[];

   double sp2qk[];


void OnInit()

  {

   Ichimoku = new CiIchimoku();

   Ichimoku.Create(_Symbol,PERIOD_CURRENT,9,26,52);

     

   SetIndexBuffer(0,trendtang,INDICATOR_DATA);   

   SetIndexBuffer(1,sp1tl,INDICATOR_DATA);

   SetIndexBuffer(2,sp2tl,INDICATOR_DATA);

   SetIndexBuffer(3,tenqk,INDICATOR_DATA);

   SetIndexBuffer(4,kijqk,INDICATOR_DATA);

   SetIndexBuffer(5,sp1ht,INDICATOR_DATA);

   SetIndexBuffer(6,sp2ht,INDICATOR_DATA);

   SetIndexBuffer(7,sp1qk,INDICATOR_DATA);

   SetIndexBuffer(8,sp2qk,INDICATOR_DATA);

   IndicatorSetInteger(INDICATOR_DIGITS,_Digits+1);

//--- sets first bar from what index will be drawn

   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,51);

//--- lines shifts when drawing

   PlotIndexSetInteger(0,PLOT_SHIFT,25);

   }

   int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

  {

   int start;

//---

   if(prev_calculated==0)

      start=0;

   else

      start=prev_calculated-1;

//--- main loop

   for(int i=start; i<rates_total && !IsStopped(); i++)

     {

     MqlRates PArray[];

   int Data=CopyRates(_Symbol,_Period,0,1,PArray);


   Ichimoku.Refresh(-1);

   

   double spanAtl= Ichimoku.SenkouSpanA(0);

   double spanBtl= Ichimoku.SenkouSpanB(0);

   double spanAht= Ichimoku.SenkouSpanA(-25);

   double spanBht= Ichimoku.SenkouSpanB(-25);

   double spanAqk= Ichimoku.SenkouSpanA(-51);

   double spanBqk= Ichimoku.SenkouSpanB(-51);

   double tenkanqk= Ichimoku.TenkanSen(-25);

   double kijunqk= Ichimoku.KijunSen(-25);

      

      sp1tl[i]=spanAtl;

      sp2tl[i]=spanBtl;

      tenqk[i]=tenkanqk;

      kijqk[i]=kijunqk;

      sp1ht[i]=spanAht;

      sp2ht[i]=spanBht;

      sp1qk[i]=spanAqk;

      sp2qk[i]=spanBqk;

      

   if(

   sp1tl[i]>=sp2tl[i]

   && close[i]>tenqk[i]

   && close[i]>kijqk[i]

   && close[i]>sp1ht[i]

   && close[i]>sp2ht[i]

   && close[i]>sp1qk[i]

   && close[i]>sp2qk[i]

   )

   {

   trendtang[i]=sp2tl[i];

   }

   else

   {

   trendtang[i]=EMPTY_VALUE;

   }

      

     }

//---

   return(rates_total);

  }