What is wrong with this kumo cloud calculation?

 

Hi I'm trying to calculate senkansen A and senkansen B of the ichimoku system. I know that the Senka is the average of Kinjunsen and tenkansen shifted 26 periods ahead. Now 

for the purpose of the EA all I want is the ea to buy when the current close is greater than the current  senkansen A and B. So I want to say if Close[1]>SenkA and B then Buy.... the problem is the EA still does not work  as required. I suspect my code is wrong.


 
  double HighC =iHighest(NULL,0,MODE_HIGH,52,26);
   double  LowC= iLowest(NULL,0,MODE_LOW,52,26);
   
   double HighCT =iHighest(NULL,0,MODE_HIGH,9,26);//tenkansen
   double  LowCT= iLowest(NULL,0,MODE_LOW,9,26);//tenkansen
   
   double tksen= (HighCT+LowCT)/2;//tenkansen
   
  double HighCK =iHighest(NULL,0,MODE_HIGH,26,26);//kinjunsen
   double  LowCK= iLowest(NULL,0,MODE_LOW,26,26);//kinjunsen
   
   double kisen= (HighCK+LowCK)/2;//kinjunsen
   
   double SenkB= (tksen+kisen)/2;// senkansen B
   double senkA=(HighC+LowC)/2;//senkansen A

thanks.

 
prweza:

Hi I'm trying to calculate senkansen A and senkansen B of the ichimoku system. I know that the Senka is the average of Kinjunsen and tenkansen shifted 26 periods ahead. Now 

for the purpose of the EA all I want is the ea to buy when the current close is greater than the current  senkansen A and B. So I want to say if Close[1]>SenkA and B then Buy.... the problem is the EA still does not work  as required. I suspect my code is wrong.


thanks.


please would be grateful for any help.

Reason: