View Single Post
  #6 (permalink)  
Old 04-17-2006, 08:57 PM
niva's Avatar
niva niva is offline
Senior Member
 
Join Date: Mar 2006
Posts: 101
niva is on a distinguished road
Quote:
Originally Posted by babarmughal
Thanks David,

Yes there is MACD sample in my EA but I want to make an EA based on histogram..that BUY when the first histogram bar closes above "0" and sell when the first histogram bar closes below zero ....and at the same time it has to close the long position......I wonder if someone can make EA for this...

Thanks
Babar
Your idea is lot easier that the sample MACD, doesn't need to deal with the signal line at least.

If you open the MACD indicator, not the EA, with MataEditor, you can see it is actually use a iMA() function to sign values in to the ind_buffer1[] array. This how the indicator produced histogram.

When the histogram value is positive the iMA() value is also positive. Hope you understand the mechanism.

Similarly, the indicator use this line to produce the red signal line.
ind_buffer2[i]=iMAOnArray(ind_buffer1,Bars,SignalSMA,0,MODE_SMA, i);
__________________
Forex TSD is NO. 1
EA's blog: http://eaconfigs.blogspot.com/
Reply With Quote