Detected Country () : English
Ichimoku Multi Timeframe - codingforex.com

Welcome to CodingForex.Com!

Knowledge portal where you can learn how to create forex indicators and robot.

Click button below to choose level that suite you:

Ichimoku Multi Timeframe

Samples [2018-11-20 09:01:47] - by hillzx
Featured Image

ichi

Hello traders, we go back to the tutorial session, on this occasion we will learn to make indicators using Ichimoku. Ichimoku is the default indicator of the MetaTrader Platform, there are quite a lot of trader use this kind of indicator.

 

There are several techniques that people usually use to trade using Ichimoku, but basically this Ichimoku categorizes the chart into 3 zones, namely:

  1. Zone above cloud (up trend)
  2. Zone inside the cloud (zigzag / ranging)
  3. Zone below cloud (down trend)

 

Usually traders use several timeframes at the same time to find entry, for example if the current price is above the cloud / rising trend in the H4 timeframe then the trader will try to enter in a smaller timeframe for example H1 which is in the direction of a larger timeframe.

 

But unfortunately, we have to change the timeframe often and many times we have to make sure the price is in which zone. If we make the indicator, of course we can read the Ichimoku zone faster, right?

 

OK, the targets for this indicator are :

  1. Can see the current trend directly through the cloud zone
  2. Can see all data cloud from many timeframes
  3. Can get alerts when 3 timeframes are in the same direction

 


Let us create the indicator, first we create 3 ENUM, the first Corner to determine the angle of the location of the indicator, then TimeFocus to determine the timeframe, then GroupAlert to make alert notification if the three timeframes are having the same trend:

enum Corners 
  {
   Left_Top=0,     // Left_Top
   Right_Top=1,     // Right_Top
   Left_Bottom=2,     // Left_Bottom
   Right_Bottom=3,     // Right_Bottom
  };

enum TimeFocus 
  {
   M15=15,     // M15
   M30=30,     // M30
   H1=60,     // H1
   H4=240,     // H4
   D1=1440,      // D1
   W1=10080 //W1
  };
  

enum GroupAlerts 
  {
   M15_M30_H1=1,     // M15_M30_H1
   M30_H1_H4=2,     // M30_H1_H4
   H1_H4_D1=3,     // H1_H4_D1
   H4_D1_W1=4    // H4_D1_W1
 
  };
  



ichi input

Next we make input:

int colorHiLLzxFlag=1;
int oldTime;

bool newCandle=true;

extern string Settings_1="==== Time Settings ====";
extern TimeFocus TimeFrameFocus=H1;
extern bool Show_M15=true;
extern bool Show_M30=true;
extern bool Show_H1=true;
extern bool Show_H4=true;
extern bool Show_D1=true;
extern bool Show_W1=true;

extern string Settings_2="==== GUI Settings ====";
extern Corners Corner=Left_Top;

extern string Settings_3="==== Alert Settings ====";
extern GroupAlerts GroupAlert=H4_D1_W1;
extern bool EnableAlert=true;
extern bool EmailAlert=false;
extern bool PopupAlert=true;


color curColor;
int YPos = 10;
int XPos = 10;



Followed by the Init module code which will be executed at the beginning, the Deinit to be executed at the end, and DeleteObjects to delete the object:

void DeleteObjects()
{
  for (int i = ObjectsTotal() - 1; i > -1; i--)
  {
  if (StringFind(ObjectName(i), "HiLLzXCloud") >= 0) ObjectDelete(ObjectName(i));
  }
}

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
DeleteObjects();

oldTime=Time[0];

   
Display();
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
DeleteObjects();
return;
  }

 

Type the following code to detect three different timeframes to send alerts:

void CheckAlert_M15_M30_H1(){

string priceA=GetIchiTrendWord(PERIOD_M15,1);
string priceB=GetIchiTrendWord(PERIOD_M30,1);
string priceC=GetIchiTrendWord(PERIOD_H1,1);

string priceABefore=GetIchiTrendWord(PERIOD_M15,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on M15 + M30 + H1");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on M15 + M30 + H1");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on M15 + M30 + H1");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on M15 + M30 + H1");
      }
   
   }

}

return;
}

void CheckAlert_M30_H1_H4(){

string priceA=GetIchiTrendWord(PERIOD_M30,1);
string priceB=GetIchiTrendWord(PERIOD_H1,1);
string priceC=GetIchiTrendWord(PERIOD_H4,1);

string priceABefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on M30 + H1 + H4");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on M30 + H1 + H4");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on M30 + H1 + H4");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on M30 + H1 + H4");
      }
   
   }

}

return;
}

void CheckAlert_H1_H4_D1(){

string priceA=GetIchiTrendWord(PERIOD_H1,1);
string priceB=GetIchiTrendWord(PERIOD_H4,1);
string priceC=GetIchiTrendWord(PERIOD_D1,1);

string priceABefore=GetIchiTrendWord(PERIOD_H1,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on H1 + H4 + D1");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on H1 + H4 + D1");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on H1 + H4 + D1");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on H1 + H4 + D1");
      }
   
   }

}

return;
}

void CheckAlert_H4_D1_W1(){

string priceA=GetIchiTrendWord(PERIOD_H4,1);
string priceB=GetIchiTrendWord(PERIOD_D1,1);
string priceC=GetIchiTrendWord(PERIOD_W1,1);

string priceABefore=GetIchiTrendWord(PERIOD_H4,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on H4 + D1 + W1");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on H4 + D1 + W1");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on H4 + D1 + W1");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on H4 + D1 + W1");
      }
   
   }

}

return;
}



Type the following code to determine the direction of the Ichimoku trend:

string GetIchiTrend(int tf,int candle){

double cloudA=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANA,candle);
double cloudB=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANB,candle);
double curClose=iClose(Symbol(),tf,candle);
string trend;

   if ( (curClose>cloudA) && (curClose>cloudB) )
   {
      trend=CharToStr(217);
      curColor=Lime;
   } else if ( (curClose<cloudA) && (curClose<cloudB) )
   {
      trend=CharToStr(218);
      curColor=Red;
   } else 
   {
      trend=CharToStr(73);
      curColor=Gray;
   }
   

   
   return trend;
}

string GetIchiTrendWord(int tf,int candle){

double cloudA=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANA,candle);
double cloudB=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANB,candle);
double curClose=iClose(Symbol(),tf,candle);
string trend;

   if ( (curClose>cloudA) && (curClose>cloudB) )
   {
      trend="Up";
   } else if ( (curClose<cloudA) && (curClose<cloudB) )
   {
      trend="Down";
   } else 
   {
      trend="Neutral";
   }
   

   
   return trend;
}

 

Type the following code to display text on the screen:

void Display(){

ObjectCreate("HiLLzXCloudTitle1", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudTitle1", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudTitle1", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudTitle1", OBJPROP_YDISTANCE,  YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudTitle1","--------------"   ,14,"Verdana",DarkOrange);
   
   ObjectCreate("HiLLzXCloudTitle", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudTitle", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudTitle", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudTitle", OBJPROP_YDISTANCE, 20 +  YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudTitle","HiLLzX Cloud"   ,14,"Verdana",White);
   
   ObjectCreate("HiLLzXCloudTitle2", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudTitle2", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudTitle2", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudTitle2", OBJPROP_YDISTANCE, 40 +  YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudTitle2","--------------"   ,14,"Verdana",DarkOrange);
   
   ObjectCreate("HiLLzXCloudInfo1", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo1", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo1", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo1", OBJPROP_YDISTANCE, 60 + YPos);// Y coordinate
   if(TimeFrameFocus==M15){
      ObjectSetText("HiLLzXCloudInfo1","Cloud M15 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo1","Cloud M15 : "   ,12,"Verdana",White);
   }
   
   ObjectCreate("HiLLzXCloudArrow1", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow1", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow1", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow1", OBJPROP_YDISTANCE, 60 + YPos);// Y coordinate
   
   if (Show_M15){
      ObjectSetText("HiLLzXCloudArrow1",GetIchiTrend(PERIOD_M15,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow1",GetIchiTrend(PERIOD_M15,1) ,12,"Wingdings",Black);
   }
   
   
   ObjectCreate("HiLLzXCloudInfo2", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo2", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo2", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo2", OBJPROP_YDISTANCE, 80 + YPos);// Y coordinate
   if(TimeFrameFocus==M30){
      ObjectSetText("HiLLzXCloudInfo2","Cloud M30 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo2","Cloud M30 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow2", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow2", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow2", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow2", OBJPROP_YDISTANCE, 80 + YPos);// Y coordinate
   
   if (Show_M30){
      ObjectSetText("HiLLzXCloudArrow2",GetIchiTrend(PERIOD_M30,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow2",GetIchiTrend(PERIOD_M30,1) ,12,"Wingdings",Black);
   }
   
   ObjectCreate("HiLLzXCloudInfo3", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo3", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo3", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo3", OBJPROP_YDISTANCE, 100 + YPos);// Y coordinate
   if(TimeFrameFocus==H1){
      ObjectSetText("HiLLzXCloudInfo3","Cloud H1 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo3","Cloud H1 : "   ,12,"Verdana",White);
   }
   

   ObjectCreate("HiLLzXCloudArrow3", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow3", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow3", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow3", OBJPROP_YDISTANCE, 100 + YPos);// Y coordinate
   
   if (Show_H1){
      ObjectSetText("HiLLzXCloudArrow3",GetIchiTrend(PERIOD_H1,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow3",GetIchiTrend(PERIOD_H1,1) ,12,"Wingdings",Black);
   }
   
   ObjectCreate("HiLLzXCloudInfo4", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo4", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo4", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo4", OBJPROP_YDISTANCE, 120 + YPos);// Y coordinate
   if(TimeFrameFocus==H4){
      ObjectSetText("HiLLzXCloudInfo4","Cloud H4 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo4","Cloud H4 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow4", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow4", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow4", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow4", OBJPROP_YDISTANCE, 120 + YPos);// Y coordinate
   
   if (Show_H4){
      ObjectSetText("HiLLzXCloudArrow4",GetIchiTrend(PERIOD_H4,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow4",GetIchiTrend(PERIOD_H4,1) ,12,"Wingdings",Black);
   }
   

   ObjectCreate("HiLLzXCloudInfo5", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo5", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo5", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo5", OBJPROP_YDISTANCE, 140 + YPos);// Y coordinate
   if(TimeFrameFocus==D1){
      ObjectSetText("HiLLzXCloudInfo5","Cloud D1 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo5","Cloud D1 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow5", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow5", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow5", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow5", OBJPROP_YDISTANCE, 140 + YPos);// Y coordinate
   
   if (Show_D1){
      ObjectSetText("HiLLzXCloudArrow5",GetIchiTrend(PERIOD_D1,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow5",GetIchiTrend(PERIOD_D1,1) ,12,"Wingdings",Black);
   }

   ObjectCreate("HiLLzXCloudInfo6", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo6", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo6", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo6", OBJPROP_YDISTANCE, 160 + YPos);// Y coordinate
   if(TimeFrameFocus==W1){
      ObjectSetText("HiLLzXCloudInfo6","Cloud W1 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo6","Cloud W1 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow6", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow6", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow6", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow6", OBJPROP_YDISTANCE, 160 + YPos);// Y coordinate

   if (Show_W1){
      ObjectSetText("HiLLzXCloudArrow6",GetIchiTrend(PERIOD_W1,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow6",GetIchiTrend(PERIOD_W1,1) ,12,"Wingdings",Black);
   }
   


   ObjectCreate("HiLLzXCloudLine3", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudLine3", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudLine3", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudLine3", OBJPROP_YDISTANCE,  180 + YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudLine3","--------------"   ,14,"Verdana",DarkOrange);




return;
}



Finally, type the OnCalculate code as the main module to call all codes:

//------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---

if(oldTime != Time[0] )
{
   oldTime = Time[0];
   Display();
   newCandle=true;
}


   color colorHiLLzx;
   
   if (colorHiLLzxFlag==1){colorHiLLzx=Red;colorHiLLzxFlag=2;}else{colorHiLLzx=Yellow;colorHiLLzxFlag=1;}
   ObjectCreate("HiLLzXCloudInfo10", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo10", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo10", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo10", OBJPROP_YDISTANCE, 200+ YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudInfo10"," CodingForex.Com" ,12,"Verdana",colorHiLLzx);


if ( (EnableAlert) && (newCandle) ){

   if (GroupAlert==M15_M30_H1)
   {
      CheckAlert_M15_M30_H1();
   } else if (GroupAlert==M30_H1_H4)
   {
      CheckAlert_M30_H1_H4();
   } else if (GroupAlert==H1_H4_D1)
   {
      CheckAlert_H1_H4_D1();
   } else if (GroupAlert==H4_D1_W1)
   {
      CheckAlert_H4_D1_W1();
   }



}

newCandle=false;
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

 


Here is the complete code ready to use, just copy and then compile it:

//+------------------------------------------------------------------+
//|                                                        Cloud.mq4 |
//|                                                           HiLLzX |
//|                                           http://codingforex.com |
//+------------------------------------------------------------------+
#property copyright "HiLLzX"
#property link      "http://codingforex.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

enum Corners 
  {
   Left_Top=0,     // Left_Top
   Right_Top=1,     // Right_Top
   Left_Bottom=2,     // Left_Bottom
   Right_Bottom=3,     // Right_Bottom
  };

enum TimeFocus 
  {
   M15=15,     // M15
   M30=30,     // M30
   H1=60,     // H1
   H4=240,     // H4
   D1=1440,      // D1
   W1=10080 //W1
  };
  

enum GroupAlerts 
  {
   M15_M30_H1=1,     // M15_M30_H1
   M30_H1_H4=2,     // M30_H1_H4
   H1_H4_D1=3,     // H1_H4_D1
   H4_D1_W1=4    // H4_D1_W1
 
  };
  
int colorHiLLzxFlag=1;
int oldTime;

bool newCandle=true;

extern string Settings_1="==== Time Settings ====";
extern TimeFocus TimeFrameFocus=H1;
extern bool Show_M15=true;
extern bool Show_M30=true;
extern bool Show_H1=true;
extern bool Show_H4=true;
extern bool Show_D1=true;
extern bool Show_W1=true;

extern string Settings_2="==== GUI Settings ====";
extern Corners Corner=Left_Top;

extern string Settings_3="==== Alert Settings ====";
extern GroupAlerts GroupAlert=H4_D1_W1;
extern bool EnableAlert=true;
extern bool EmailAlert=false;
extern bool PopupAlert=true;


color curColor;
int YPos = 10;
int XPos = 10;

void DeleteObjects()
{
  for (int i = ObjectsTotal() - 1; i > -1; i--)
  {
  if (StringFind(ObjectName(i), "HiLLzXCloud") >= 0) ObjectDelete(ObjectName(i));
  }
}

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
DeleteObjects();

oldTime=Time[0];

   
Display();
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
DeleteObjects();
return;
  }

void CheckAlert_M15_M30_H1(){

string priceA=GetIchiTrendWord(PERIOD_M15,1);
string priceB=GetIchiTrendWord(PERIOD_M30,1);
string priceC=GetIchiTrendWord(PERIOD_H1,1);

string priceABefore=GetIchiTrendWord(PERIOD_M15,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on M15 + M30 + H1");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on M15 + M30 + H1");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on M15 + M30 + H1");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on M15 + M30 + H1");
      }
   
   }

}

return;
}

void CheckAlert_M30_H1_H4(){

string priceA=GetIchiTrendWord(PERIOD_M30,1);
string priceB=GetIchiTrendWord(PERIOD_H1,1);
string priceC=GetIchiTrendWord(PERIOD_H4,1);

string priceABefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on M30 + H1 + H4");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on M30 + H1 + H4");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on M30 + H1 + H4");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on M30 + H1 + H4");
      }
   
   }

}

return;
}

void CheckAlert_H1_H4_D1(){

string priceA=GetIchiTrendWord(PERIOD_H1,1);
string priceB=GetIchiTrendWord(PERIOD_H4,1);
string priceC=GetIchiTrendWord(PERIOD_D1,1);

string priceABefore=GetIchiTrendWord(PERIOD_H1,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on H1 + H4 + D1");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on H1 + H4 + D1");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on H1 + H4 + D1");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on H1 + H4 + D1");
      }
   
   }

}

return;
}

void CheckAlert_H4_D1_W1(){

string priceA=GetIchiTrendWord(PERIOD_H4,1);
string priceB=GetIchiTrendWord(PERIOD_D1,1);
string priceC=GetIchiTrendWord(PERIOD_W1,1);

string priceABefore=GetIchiTrendWord(PERIOD_H4,2);
//string priceBBefore=GetIchiTrendWord(PERIOD_M30,2);
//string priceCBefore=GetIchiTrendWord(PERIOD_H1,2);

if ( (priceA!=priceABefore) && (priceA==priceB) && (priceA==priceC) )
{

   if (EmailAlert)
   {
      if (priceA=="Up")
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Buy " + Symbol() + " confirmed on H4 + D1 + W1");
      } else if (priceA=="Down") //Down
      {
         SendMail("HiLLzX Cloud Alert " + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()),"Sell " + Symbol() + " confirmed on H4 + D1 + W1");
      }
      
   }
   
   if (PopupAlert)
   {
      if (priceA=="Up")
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nBuy " + Symbol() + " confirmed on H4 + D1 + W1");
      } else if (priceA=="Down") //Down
      {
         Alert("HiLLzX Cloud Alert\n" + TimeToStr(CurTime(),TIME_DATE)+" "+TimeHour(CurTime())+":"+TimeMinute(CurTime()) + "\nSell " + Symbol() + " confirmed on H4 + D1 + W1");
      }
   
   }

}

return;
}

string GetIchiTrend(int tf,int candle){

double cloudA=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANA,candle);
double cloudB=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANB,candle);
double curClose=iClose(Symbol(),tf,candle);
string trend;

   if ( (curClose>cloudA) && (curClose>cloudB) )
   {
      trend=CharToStr(217);
      curColor=Lime;
   } else if ( (curClose<cloudA) && (curClose<cloudB) )
   {
      trend=CharToStr(218);
      curColor=Red;
   } else 
   {
      trend=CharToStr(73);
      curColor=Gray;
   }
   

   
   return trend;
}

string GetIchiTrendWord(int tf,int candle){

double cloudA=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANA,candle);
double cloudB=iIchimoku(NULL,tf,9,26,52,MODE_SENKOUSPANB,candle);
double curClose=iClose(Symbol(),tf,candle);
string trend;

   if ( (curClose>cloudA) && (curClose>cloudB) )
   {
      trend="Up";
   } else if ( (curClose<cloudA) && (curClose<cloudB) )
   {
      trend="Down";
   } else 
   {
      trend="Neutral";
   }
   

   
   return trend;
}

     
void Display(){

ObjectCreate("HiLLzXCloudTitle1", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudTitle1", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudTitle1", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudTitle1", OBJPROP_YDISTANCE,  YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudTitle1","--------------"   ,14,"Verdana",DarkOrange);
   
   ObjectCreate("HiLLzXCloudTitle", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudTitle", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudTitle", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudTitle", OBJPROP_YDISTANCE, 20 +  YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudTitle","HiLLzX Cloud"   ,14,"Verdana",White);
   
   ObjectCreate("HiLLzXCloudTitle2", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudTitle2", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudTitle2", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudTitle2", OBJPROP_YDISTANCE, 40 +  YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudTitle2","--------------"   ,14,"Verdana",DarkOrange);
   
   ObjectCreate("HiLLzXCloudInfo1", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo1", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo1", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo1", OBJPROP_YDISTANCE, 60 + YPos);// Y coordinate
   if(TimeFrameFocus==M15){
      ObjectSetText("HiLLzXCloudInfo1","Cloud M15 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo1","Cloud M15 : "   ,12,"Verdana",White);
   }
   
   ObjectCreate("HiLLzXCloudArrow1", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow1", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow1", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow1", OBJPROP_YDISTANCE, 60 + YPos);// Y coordinate
   
   if (Show_M15){
      ObjectSetText("HiLLzXCloudArrow1",GetIchiTrend(PERIOD_M15,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow1",GetIchiTrend(PERIOD_M15,1) ,12,"Wingdings",Black);
   }
   
   
   ObjectCreate("HiLLzXCloudInfo2", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo2", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo2", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo2", OBJPROP_YDISTANCE, 80 + YPos);// Y coordinate
   if(TimeFrameFocus==M30){
      ObjectSetText("HiLLzXCloudInfo2","Cloud M30 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo2","Cloud M30 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow2", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow2", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow2", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow2", OBJPROP_YDISTANCE, 80 + YPos);// Y coordinate
   
   if (Show_M30){
      ObjectSetText("HiLLzXCloudArrow2",GetIchiTrend(PERIOD_M30,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow2",GetIchiTrend(PERIOD_M30,1) ,12,"Wingdings",Black);
   }
   
   ObjectCreate("HiLLzXCloudInfo3", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo3", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo3", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo3", OBJPROP_YDISTANCE, 100 + YPos);// Y coordinate
   if(TimeFrameFocus==H1){
      ObjectSetText("HiLLzXCloudInfo3","Cloud H1 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo3","Cloud H1 : "   ,12,"Verdana",White);
   }
   

   ObjectCreate("HiLLzXCloudArrow3", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow3", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow3", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow3", OBJPROP_YDISTANCE, 100 + YPos);// Y coordinate
   
   if (Show_H1){
      ObjectSetText("HiLLzXCloudArrow3",GetIchiTrend(PERIOD_H1,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow3",GetIchiTrend(PERIOD_H1,1) ,12,"Wingdings",Black);
   }
   
   ObjectCreate("HiLLzXCloudInfo4", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo4", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo4", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo4", OBJPROP_YDISTANCE, 120 + YPos);// Y coordinate
   if(TimeFrameFocus==H4){
      ObjectSetText("HiLLzXCloudInfo4","Cloud H4 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo4","Cloud H4 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow4", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow4", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow4", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow4", OBJPROP_YDISTANCE, 120 + YPos);// Y coordinate
   
   if (Show_H4){
      ObjectSetText("HiLLzXCloudArrow4",GetIchiTrend(PERIOD_H4,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow4",GetIchiTrend(PERIOD_H4,1) ,12,"Wingdings",Black);
   }
   

   ObjectCreate("HiLLzXCloudInfo5", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo5", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo5", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo5", OBJPROP_YDISTANCE, 140 + YPos);// Y coordinate
   if(TimeFrameFocus==D1){
      ObjectSetText("HiLLzXCloudInfo5","Cloud D1 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo5","Cloud D1 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow5", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow5", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow5", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow5", OBJPROP_YDISTANCE, 140 + YPos);// Y coordinate
   
   if (Show_D1){
      ObjectSetText("HiLLzXCloudArrow5",GetIchiTrend(PERIOD_D1,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow5",GetIchiTrend(PERIOD_D1,1) ,12,"Wingdings",Black);
   }

   ObjectCreate("HiLLzXCloudInfo6", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo6", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo6", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo6", OBJPROP_YDISTANCE, 160 + YPos);// Y coordinate
   if(TimeFrameFocus==W1){
      ObjectSetText("HiLLzXCloudInfo6","Cloud W1 : "   ,12,"Verdana",Yellow);
   } else {
      ObjectSetText("HiLLzXCloudInfo6","Cloud W1 : "   ,12,"Verdana",White);
   }

   ObjectCreate("HiLLzXCloudArrow6", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudArrow6", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudArrow6", OBJPROP_XDISTANCE, 110 + XPos);// X coordinate
   ObjectSet("HiLLzXCloudArrow6", OBJPROP_YDISTANCE, 160 + YPos);// Y coordinate

   if (Show_W1){
      ObjectSetText("HiLLzXCloudArrow6",GetIchiTrend(PERIOD_W1,1) ,12,"Wingdings",curColor);
   } else {
      ObjectSetText("HiLLzXCloudArrow6",GetIchiTrend(PERIOD_W1,1) ,12,"Wingdings",Black);
   }
   


   ObjectCreate("HiLLzXCloudLine3", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudLine3", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudLine3", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudLine3", OBJPROP_YDISTANCE,  180 + YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudLine3","--------------"   ,14,"Verdana",DarkOrange);




return;
}
//------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---

if(oldTime != Time[0] )
{
   oldTime = Time[0];
   Display();
   newCandle=true;
}


   color colorHiLLzx;
   
   if (colorHiLLzxFlag==1){colorHiLLzx=Red;colorHiLLzxFlag=2;}else{colorHiLLzx=Yellow;colorHiLLzxFlag=1;}
   ObjectCreate("HiLLzXCloudInfo10", OBJ_LABEL, 0, 0, 0);// Creating obj.
   ObjectSet("HiLLzXCloudInfo10", OBJPROP_CORNER, Corner);    // Reference Corner
   ObjectSet("HiLLzXCloudInfo10", OBJPROP_XDISTANCE, XPos);// X coordinate
   ObjectSet("HiLLzXCloudInfo10", OBJPROP_YDISTANCE, 200+ YPos);// Y coordinate
   ObjectSetText("HiLLzXCloudInfo10"," CodingForex.Com" ,12,"Verdana",colorHiLLzx);


if ( (EnableAlert) && (newCandle) ){

   if (GroupAlert==M15_M30_H1)
   {
      CheckAlert_M15_M30_H1();
   } else if (GroupAlert==M30_H1_H4)
   {
      CheckAlert_M30_H1_H4();
   } else if (GroupAlert==H1_H4_D1)
   {
      CheckAlert_H1_H4_D1();
   } else if (GroupAlert==H4_D1_W1)
   {
      CheckAlert_H4_D1_W1();
   }



}

newCandle=false;
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+


Let us try, do not forget to share and follow our facebook and our youtube channel, happy trading!






- Provided by HiLLzSoft Studio -