molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming
http://www.molanis.com/forum/

MACD Histogram
http://www.molanis.com/forum/viewtopic.php?f=3&t=353
Page 2 of 2

Author:  molanisfx [ Wed May 18, 2011 9:31 am ]
Post subject:  Re: MACD Histogram

Quote:
When a fast MA crosses upwards the slower MA and the position is only available after 4 bars

Do not understand what you mean with the position is only available after 4 bars?
What you have there is not a real crossover (see the examples) You are comparing the previous bar with a bar with a signal 6 bars ago. Lots of things can happen during 6 bars.
Also, I wouldn't use bid in the conditions since you are trading bars (open or close of the previous bar would be better See http://www.molanis.com/support/faq#setup4)
Read this http://ta.mql4.com/indicators/oscillators/macd
The Moving Average Convergence/Divergence (MACD) Technical Indicator is the difference between a 26-period and 12-period Exponential Moving Average (EMA). So at the end of the day you want to use 2 ma crosses at the same time. (Ask yourself if using one will suffice)

Author:  xikky [ Thu May 19, 2011 2:09 am ]
Post subject:  Re: MACD Histogram

I'm really figuring out more how this works each day I experimenting with the program!

Another question I have is: is it possible make this condition... When both conditions of 2 TAs (or more) are met together with the 3rd TA OR the 4th TA, a signal is given. In other words, mixing AND with OR.

Author:  xikky [ Thu May 19, 2011 8:24 am ]
Post subject:  Re: MACD Histogram

ok .. i got a work-around for the previous question. But I'm still trying to make my MACD Histogram work for the EA. I am going to include the indicator and a screen shot of it.

I would really like to know if it is possible to buy if histogram is showing green bars (above 0) and sell if histogram is showing red bars (below 0)

Attachments:
File comment: indicator
MACD 2 Colour HISTOGRAM.ex4 [3.6 KiB]
Downloaded 589 times
File comment: indicator
MACD 2 Colour HISTOGRAM.mq4 [3.54 KiB]
Downloaded 599 times
File comment: MACD historgram indicator
macd histogram.jpg
macd histogram.jpg [ 400.25 KiB | Viewed 4022 times ]

Author:  molanisfx [ Thu May 19, 2011 11:17 am ]
Post subject:  Re: MACD Histogram

To use a custom indicator you need to import it in the TA (look for custom indicator option and click import)
The indicator you posted works this way:

#property indicator_color1 Green
#property indicator_color2 Red

SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_HISTOGRAM);


The code above (from the indicator) tells me that the mode 0 is the green histogram. Mode 1 is the red histogram. Thus to buy use mode 0 > 0 and to sell use mode 1 > 0

Try that in a separated strategy. (only the macd) to make it easier.

Please note that the signals are for the indicator you attached (it has colors in the histogram). The default macd that comes with mt4 does not have colors and signals are different.

Page 2 of 2 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/