EA based on Heiken Ashi - page 3

 
nix:
have you tested this forward by demo or live trading? i'm not talking about visual backtesting which doesn't prove anything. The previously posted eas killed the account in the long run i.e. During long consolidation periods.

I've backtested your settings for the heiken_ashi_smooth indicator with the stop & reverse method so you can see the results. Heiken ashi repaints and therefor the results are what they are.

hi

i cannot seem to load this ea on my mt4 can you help

 

Is anyone trading Heiken Ashi ?

Just wondering if anyone is actively trading using any of the HA indicators?

 
nix:
I like the SL/TP idea, but please elaborate on the entry after TP or SL is hit.

Say the previous bar was RED and the new one is BLUE - the EA goes long, but hits SL (meanwhile the bars remain BLUE) - What do we do? Wait till the bars shift into RED or re enter with the HA trend? What if we hit TP instead of SL?

It is no problem for me to code any EA as long as I have the correct formula/algorithm for it.

Hi Nix

I'm glad that you're willing to code EA. I have Heiken Ashi indicator which have two lines (like MA), indicating an up trend when one line move upward and crossed the other and vice versa. It is very consistence and reliable, as long as when there's a cross over, there is a trend! But I need you or someone to write an EA for this.

I can be reached by my email address: kenneth_opc@yahoo.com

 

Hama_

Hello, can someone explane me the mql4 code of this indicator.

I want to create EA but I cant understand how to make iCustom command to work with it, I want to open short and long positions when HAMA change color, but I cant understand how to do this.

hama_.mq4

I attached indicator.

Indicator code:

//+------------------------------------------------------------------+

//| Heiken_Ashi_EMA.mq4 |

//+------------------------------------------------------------------+

//| mod by W |

//+------------------------------------------------------------------+

#property copyright ""

#property link ""

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 DarkOrange

#property indicator_color2 Turquoise

#property indicator_color3 Red

#property indicator_color4 RoyalBlue

//---- parameters

string Your.Registration.Code="DEM063011hp";

int MaMetod = 1;

int MaPeriod = 20;

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

double ExtMapBuffer4[];

//----

int ExtCountedBars=0;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//|------------------------------------------------------------------|

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_NONE, 0, 2, Red);

SetIndexBuffer(0, ExtMapBuffer1);

SetIndexStyle(1,DRAW_NONE, 0, 2, RoyalBlue);

SetIndexBuffer(1, ExtMapBuffer2);

SetIndexStyle(2,DRAW_HISTOGRAM, 0, 2, Red);

SetIndexBuffer(2, ExtMapBuffer3);

SetIndexStyle(3,DRAW_HISTOGRAM, 0, 2, RoyalBlue);

SetIndexBuffer(3, ExtMapBuffer4);

//----

SetIndexDrawBegin(0,5);

//---- indicator buffers mapping

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexBuffer(3,ExtMapBuffer4);

//---- initialization done

watermark();

return(0);

}

//+------------------------------------------------------------------+

//| Custor indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//---- TODO: add your code here

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

double maOpen, maClose, maLow, maHigh;

double haOpen, haHigh, haLow, haClose;

if(Bars<=10) return(0);

ExtCountedBars=IndicatorCounted();

//---- check for possible errors

if (ExtCountedBars<0) return(-1);

//---- last counted bar will be recounted

if (ExtCountedBars>0) ExtCountedBars--;

int pos=Bars-ExtCountedBars-1;

while(pos>=0)

{

maOpen=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_OPEN,pos);

maClose=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_CLOSE,pos);

maLow=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_LOW,pos);

maHigh=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_HIGH,pos);

haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2;

haClose=(maOpen+maHigh+maLow+maClose)/4;

haHigh=MathMax(maHigh, MathMax(haOpen, haClose));

haLow=MathMin(maLow, MathMin(haOpen, haClose));

if (haOpen<haClose)

{

ExtMapBuffer1[pos]=haLow;

ExtMapBuffer2[pos]=haHigh;

}

else

{

ExtMapBuffer1[pos]=haHigh;

ExtMapBuffer2[pos]=haLow;

}

ExtMapBuffer3[pos]=haOpen;

ExtMapBuffer4[pos]=haClose;

pos--;

}

//----

return(0);

}

//+------------------------------------------------------------------+

void watermark()

{

ObjectCreate("", OBJ_LABEL, 0, 0, 0);

ObjectSetText("", "", 8, "Verdana", RoyalBlue);

ObjectSet("", OBJPROP_CORNER, 2);

ObjectSet("", OBJPROP_XDISTANCE, 5);

ObjectSet("", OBJPROP_YDISTANCE, 5);

return(0);

}
Files:
hama_.mq4  4 kb
 
rokasearner:
Hello, can someone explane me the mql4 code of this indicator.

I want to create EA but I cant understand how to make iCustom command to work with it, I want to open short and long positions when HAMA change color, but I cant understand how to do this.

hama_.mq4

I attached indicator.

Indicator code:

Hello Rokasearner, to call that indicator for color change can try something like this

double haRedNow = iCustom(NULL,0,"Heiken_Ashi_Ema",MaMetod,MaPeriod,2,1);

double haRedPre = iCustom(NULL,0,"Heiken_Ashi_Ema",MaMetod,MaPeriod,2,1);

double haBlueNow = iCustom(NULL,0,"Heiken_Ashi_Ema",MaMetod,MaPeriod,3,2);

double haBluePre = iCustom(NULL,0,"Heiken_Ashi_Ema",MaMetod,MaPeriod,3,2);

if (haRedNow haBluePre) // for buy

if (haRedNow > haBlueNow && haRedPre < haBluePre) // for sell

But would recommend to change this in the indicator code MODE_OPEN,MODE_CLOSE,MODE_HIGH, and MODE_LOW in its moving averages, to, PRICE_OPEN,PRICE_CLOSE,PRICE_HIGH, and PRICE_LOW.

 

Hello.

I am almost new to forex.

I need a Meta Trader 4 programmer, to program a very simple EA for me, with my strategy, and to get the mq4 and ex4 files.

You can sell the EA, with my strategy, and we can share the profits- Half for you, and half for me- I trust you.

Or I can help you, FOR FREE, with other things, like publicity to your site, or translations to other languages, or

any other thing that I can help.

Sorry, but I don't have money to pay for this EA.

Thank you.

E-mail: atat@myx.net

 

Hello nix.

Can you please write your E-mail.

I want to ask you something.

Thanks.

 

Hello all traders.

I am allmost new to forex.

Can somebody please explain to me, what does "Leverage" means exactly, with examples ?

Thanks.

 

Hello.

Can somebody please tell me, about Heiken Ashi Indicator, how do I change the position of the candles, to appear more to the left or to the right ?

I am almost new to forex, and I don't know MQL programming.

Thank you.

 
9527GNUyfr:
Hello.

Can somebody please tell me, about Heiken Ashi Indicator, how do I change the position of the candles, to appear more to the left or to the right ?

I am almost new to forex, and I don't know MQL programming.

Thank you.

9527GNUyfr

You can not do that (not even as objects)

Objects are also aligned to bars time and setting the time different than the bar time does not move it in either way (as long as it does not become a part of another bar)

Reason: