Navigation:Home > Content >

Ichimoku_02.mq4

Time: 2014-01-27 | Download file:Ichimoku_02.mq4

//+------------------------------------------------------------------+
//|                                                    Ichimoku_v0.5 |
//|                                          Copyright © 2007, Volky |
//|          Not recommended for using with your real money trading. |
//|                                                                  |
//+------------------------------------------------------------------+
//Try with EURUSD 4H, USDJPY 1H, EURJPY 1H

//You can go to "Expert Properties > Inputs", and choose which kind of signals should be executed. "1" means YES, "0" means NO.
//There are 4 types of signals with this EA.
//CrossSignals1: Tenkan crosses Kijun on the "right" side of the Kumo.
//CrossSignals2: Tenkan crosses Kijun inside the Kumo.
//CrossSignals3: Tenkan crosses Kijun on the "wrong" side of the Kumo.
//KijunSignals: Prices run away from Kijun.

extern double CrossSignals1=1;
extern double CrossSignals2=1;
extern double CrossSignals3=1;
extern double KijunSignals=1;

int start()
  {
   double tenkan, kijun, senkouA, senkouB, chinkou;
   double pretenkan, prekijun, presenkouA, presenkouB, prechinkou;
   double KumoHigh, KumoLow;
   double buycross1, sellcross1, buycross2, sellcross2, buycross3, sellcross3, buyprice1, sellprice1;
   double lots=1;
   double profit=1000;
   double stop=1000;
   double noopen1, noopen2, noopen3, noopen4, noopen5, noopen6, noopen7, noopen8;
   int cnt, ticket, total;
   
   if(Bars<100)
     {
      Print("bars less than 100");
      return(0);  
     }

   tenkan=iIchimoku(NULL,0,9,26,52,MODE_TENKANSEN,1);
   kijun=iIchimoku(NULL,0,9,26,52,MODE_KIJUNSEN,1);
   senkouA=iIchimoku(NULL,0,9,26,52,MODE_SENKOUSPANA,1);
   senkouB=iIchimoku(NULL,0,9,26,52,MODE_SENKOUSPANB,1);
   chinkou=iIchimoku(NULL,0,9,26,52,MODE_CHINKOUSPAN,26);
   pretenkan=iIchimoku(NULL,0,9,26,52,MODE_TENKANSEN,2);
   prekijun=iIchimoku(NULL,0,9,26,52,MODE_KIJUNSEN,2);
   presenkouA=iIchimoku(NULL,0,9,26,52,MODE_SENKOUSPANA,2);
   presenkouB=iIchimoku(NULL,0,9,26,52,MODE_SENKOUSPANB,2);

      //KUMO
   if (senkouA>senkouB)
    {KumoHigh=senkouA;
     KumoLow=senkouB;
    }
   if (senkouA<=senkouB)
    {KumoHigh=senkouB;
     KumoLow=senkouA;
    }
   double KumoAv=(KumoHigh+KumoLow)/2;
   
   total=OrdersTotal();

   for(cnt=0;cntprekijun && tenkan<=kijun) noopen1=1;
   if (pretenkan=kijun) noopen2=1;
   if ((pretenkan>prekijun && tenkan<=kijun)||(iClose(NULL,0,2)>=KumoLow && iClose(NULL,0,1)=kijun)||(iClose(NULL,0,2)=KumoHigh)) noopen4=1;
   if ((pretenkan>prekijun && tenkan<=kijun)||(iClose(NULL,0,2)>=KumoHigh && iClose(NULL,0,1)=kijun)||(iClose(NULL,0,2)=KumoLow)) noopen6=1;
   if (pretenkan>prekijun && tenkan<=kijun) noopen7=1;
   if (pretenkan=kijun) noopen8=1;
   
   
   //on the "right side" of Kumo
   if (noopen1==0 && pretenkan<=prekijun && tenkan>kijun && iClose(NULL,0,1)>=KumoHigh) buycross1=1;
   if (noopen2==0 && pretenkan>=prekijun && tenkankijun && iClose(NULL,0,1)>=KumoLow && iClose(NULL,0,1)=prekijun && tenkan=KumoLow && iClose(NULL,0,1)kijun && iClose(NULL,0,1)=prekijun && tenkan=KumoHigh) sellcross3=1;

   //Price Leaves Kijun
   if (noopen7==0 && iLow(NULL,0,2)<=prekijun && iLow(NULL,0,1)>kijun && iLow(NULL,0,1)>=KumoHigh) buyprice1=1;
   if (noopen8==0 && iLow(NULL,0,2)>=prekijun && iLow(NULL,0,1)prekijun && tenkan<=kijun) 
       {OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
        }
      
      if(OrderMagicNumber()==2 && pretenkan=kijun) 
       {OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
       }
       
      if(OrderMagicNumber()==3)
       {if ((pretenkan>prekijun && tenkan<=kijun)||(iClose(NULL,0,2)>=KumoLow && iClose(NULL,0,1)=kijun)||(iClose(NULL,0,2)=KumoHigh)) OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
       }
      
      if(OrderMagicNumber()==5)
       {if ((pretenkan>prekijun && tenkan<=kijun)||(iClose(NULL,0,2)>=KumoHigh && iClose(NULL,0,1)=kijun)||(iClose(NULL,0,2)=KumoLow)) OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
       }
      
      if(OrderMagicNumber()==7 && pretenkan>prekijun && tenkan<=kijun) 
       {OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
        }
      
      if(OrderMagicNumber()==8 && pretenkan=kijun) 
       {OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
       }
      
      
     }
     
buycross1=0;
sellcross1=0;
buycross2=0; 
sellcross2=0;
buycross3=0;
sellcross3=0;
buyprice1=0;
sellprice1=1;            
  }

Recommend