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

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Mon Apr 29, 2024 11:23 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: MACD Histogram
PostPosted: Wed May 18, 2011 9:31 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
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)


Top
 Profile  
 
 Post subject: Re: MACD Histogram
PostPosted: Thu May 19, 2011 2:09 am 
Offline

Joined: Mon May 16, 2011 1:16 am
Posts: 8
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.


Top
 Profile  
 
 Post subject: Re: MACD Histogram
PostPosted: Thu May 19, 2011 8:24 am 
Offline

Joined: Mon May 16, 2011 1:16 am
Posts: 8
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 584 times
File comment: indicator
MACD 2 Colour HISTOGRAM.mq4 [3.54 KiB]
Downloaded 595 times
File comment: MACD historgram indicator
macd histogram.jpg
macd histogram.jpg [ 400.25 KiB | Viewed 4004 times ]
Top
 Profile  
 
 Post subject: Re: MACD Histogram
PostPosted: Thu May 19, 2011 11:17 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009