Heikin Ashi

8 replies

Lee

Subscriber, bbp_participant, community, 16 replies.

Visit profile

12 years ago #110900

How do you program Heikin Ashi ie.

If Heikin Ashi Candle has a Flat bottom Go long

If Heikein Ashi has flat top Go short

Thanks Lee

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

12 years ago #120961

it is very simple, youcan use the conditions like this:

Flat top:
Heiken Ashi High = Heiken Ashi Open & Heiken Ashi Close < Heiken Ashi Open

Flat bottom:
Heiken Ashi Low = Heiken Ashi Open & Heiken Ashi Close > Heiken Ashi Open

Mark
StrategyQuant architect

0

Lee

Subscriber, bbp_participant, community, 16 replies.

Visit profile

12 years ago #121096

Thanks Mark your a legend

0

Lee

Subscriber, bbp_participant, community, 16 replies.

Visit profile

12 years ago #121097

Hi Mark can you have a look at this and see if you can figure out why it won’t trade.

 

The basis of the strategy is go long on HA flat bottom candle and Close on flat top candle. Go short on flat top candle and close on flat bottom candle.

 

“I have no attach button” I can’t up load my strategy.

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

12 years ago #121100

If you click “More Reply Options” at the bottom, then you will see an Attachment Button appar.

0

Lee

Subscriber, bbp_participant, community, 16 replies.

Visit profile

12 years ago #121107

Thanks Stearno, I feel like a dick any way if you want to have a look at this and see what you think dunno why it won’t trade.

 

Cheers Lee

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

12 years ago #121113

Lee,

Not worries nor reasons to feel bad.  Each forum is different and place their functions differently, so makes it hard sometimes to know how to do even the simplest of things.

 

Few suggestions on your EA, if I could:

 

1. The conditions Mark suggested were:

File: rule.jpgrule.jpg

 

I think if a paragraph break was put in, then it would be a little clearer

 

Flat top: 
Heiken Ashi High = Heiken Ashi Open

& Heiken Ashi Close < Heiken Ashi Open

Flat bottom:
Heiken Ashi Low = Heiken Ashi Open

& Heiken Ashi Close > Heiken Ashi Open

 

So with that, then your conditions in the EA would need to be changed to reflect the above.  For example, your long entry would be:

 

2. Add “IsBarOpen = true” to each rule.   It is what tells the rule to now go through each of the conditions.  Without a trigger like this, then the EA would just constantly be computing and never stop.  So there needs to be something that tells it “go now on this rule”.  That is what this parameter is for and needs to be in each Rule.  For example:\

File: rule.jpgrule.jpg

 

3. Adding your to your rule a condition that says do not trade if the spread is larger than x pips, is a good condition to have.  My thought when I saw this is that 20 means 20 pips, not 20 points (or 2 pips).  So you might want to test this and confirm that these are in pips and not points for your MT4 platform with this EA.  So if I am correct, then you would need 2 for that paraemter value instead of 20.

 

0

Lee

Subscriber, bbp_participant, community, 16 replies.

Visit profile

12 years ago #121124

Thannks Stearno,

 

The 20 pips is right I had widened it to from 5 to 20 for the back test because the closing spread was between 7 and 13 on the pairs I was trying to test it on. When I have it working I’ll close the speread down to 5 pips.

 

This is how the heikin ashi candle is calculated

 

haClose = (O+H+L+C) / 4

haOpen = (previous haOpen + previous haClose) / 2

haHigh = MAX (H, haOpen, haclose)

haLow = Min (L, haOpen, haClose)

 

haOpen  always opens in the middle of the previous candles body, with that in mind for a flat botom candle we need ha high, low and close to be greater than the haOpen. Does this make sense? Am I thinking correctly?  

 

So I believe how I have wriiten the HA flat bottom formula should be correct, I’ll add the IS BAR OPEN rule to them and see how that goes.

 

Thanks mate

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

12 years ago #121126

Good luck!  Hope it fixes it for you.

 

-STearno

0

Viewing 8 replies - 1 through 8 (of 8 total)