Download MetaTrader 5

how to get trade sygnal from Heiken Ashi indicator

To add comments, please log in or register
Speed up MQL5 Cloud Network. Install Strategy Tester Agent!
adinchi
94
adinchi 2014.08.15 15:17 

Hi Colleagues,

could someone help me here, please.

 Heiken Ashi indicator has 4 buffers, that are initialized as to  DRAW_HISTOGRAM.

first of all I do not understand   how  this happens in  chart_window ?   normally I know how to draw histogram on separate window... where the buffer simply needs some value.  here is different obviously.

And second - I have checked - all 4 buffers always have some value that is around  current price - how in the end  I see only bull or bear  bars ?  I was expecting that  when the bar should be bull, then the bear buffer (or something like that)  will have zero  value and Vice versa...

 

could someone explain this to me, pleas !

 

best regards! 

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.15 18:37  
Try using Google and search heiken ashi signal.
adinchi
94
adinchi 2014.08.18 11:01  
deysmacro:
Try using Google and search heiken ashi signal.

In general it is not about heiken ashi signals... I do not understand  how candles are drown on chart window?  there are 4 DRAW_HISTOGRAM  buffers  that are used in some way that is unknown to me .... 
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.18 11:15  
Actually it is drawn with some help from maths logic. It is quite easy to understand actually.
adinchi
94
adinchi 2014.08.18 11:32  
deysmacro:
Actually it is drawn with some help from maths logic. It is quite easy to understand actually.

 suppose value in corresponding buffer is the length  of the bar.  with is #property indicator_width , BUT where is the start value?  the point from  which  these bars are drawn on chart window?  when separate window is used it is clear -  the start value is zero.  

for me the answer for that question is unknown .  will you help me with that?

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.18 13:20  
Actually you can get what you want with a bit of search at Google. Right keyword is what matters.
adinchi
94
adinchi 2014.08.18 14:57  
deysmacro:
Actually you can get what you want with a bit of search at Google. Right keyword is what matters.

this FORUM is for people who like to help.  you are not helping - so do not write here , pls.  !!!
Gatoreye
51
Gatoreye 2014.08.18 22:43  
//+------------------------------------------------------------------+
//--  Find Heiken Ashi values
//+------------------------------------------------------------------+
string GetHA(int tf, int parm, int pos=0)
{
   string rtn="", UP="UP", DOWN="DOWN";
   
   double OC=GetHAOpenPrice (tf, pos);   //current bar open
   double CC=GetHAClosePrice(tf, pos);   //current bar close
   double OP=GetHAOpenPrice (tf, pos+1); //previous bar open
   double CP=GetHAClosePrice(tf, pos+1); //previous bar close
   double O2=GetHAOpenPrice (tf, pos+2); 
   double C2=GetHAClosePrice(tf, pos+2);
   
   switch(parm)
   {
      case 1:
         if(CC>OC && CP>OP)
            rtn=UP;
         if(CC<OC && CP<OP)
            rtn=DOWN;
         break;
      
      case 2:
         if(CC>OC && CP>OP && C2>O2)
            rtn=UP;
         if(CC<OC && CP<OP && C2<O2)
            rtn=DOWN;
         break;
      
      case 3:
         if(CC>OC)
            rtn=UP;
         if(CC<OC)
            rtn=DOWN;
         break;
   }
   
   return(rtn);
}


double GetHAOpenPrice(int tf, int pos)
{
   return(iCustom(NULL, tf, "Heiken Ashi", Red, White, Red, White, 2, pos));
}


double GetHAClosePrice(int tf, int pos)
{
   return(iCustom(NULL, tf, "Heiken Ashi", Red, White, Red, White, 3, pos));  
}
adinchi
94
adinchi 2014.08.19 10:06  
gatoreyefx:


Thank you !

the key is in one not  very well documented  feature  when drawing histogram on  main window

when I have found this text:   "...The drawing mode of DRAW_HISTOGRAM having been applied to the main window indicator has its special features, as well. A histogram is drawn between corresponding values of two index arrays: an even one (here: SpanA_Buffer) and an odd one (here: SpanB_Buffer)..."

everything  becomes clear.

 

best regards ! 

To add comments, please log in or register