Download MetaTrader 5

HELP with Heiken ash candle

To add comments, please log in or register
prweza
296
prweza  

Hi,

 My void on  tick HA function looks like this

   

//heiken ashi function

double haOPEN = iCustom(NULL,0,"Heiken Ashi",Red,White,Red,White,2,0);

double haCLOSE = iCustom(NULL,0,"Heiken Ashi",Red,White,Red,White,3,0);

I want the ea to sell when the HA candle is red and buy when the HA candle is white.

 

I've used this statement: 

  if( haOPEN < haCLOSE) then buy

 if ( haOPEN > haCLOSE) then sell.

 

But the ea seems to open only buy orders is there something wrong?

 

Is there another way to select red or white HA candles?

 

Thanks. 

Alain Verleyen
Moderator
33589
Alain Verleyen  

Forum on trading, automated trading systems and testing trading strategies


Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.


Mladen Rakic
63793
Mladen Rakic  
prweza:

Hi,

 My void on  tick HA function looks like this

   

//heiken ashi function

double haOPEN = iCustom(NULL,0,"Heiken Ashi",Red,White,Red,White,2,0);

double haCLOSE = iCustom(NULL,0,"Heiken Ashi",Red,White,Red,White,3,0);

I want the ea to sell when the HA candle is red and buy when the HA candle is white.

 

I've used this statement: 

  if( haOPEN < haCLOSE) then buy

 if ( haOPEN > haCLOSE) then sell.

 

But the ea seems to open only buy orders is there something wrong?

 

Is there another way to select red or white HA candles?

 

Thanks. 

Which ha indicator are you using? Check the buffers values of it (are you checking the correct buffers numbers)
whroeder1
16275
whroeder1  
You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
To add comments, please log in or register