Establishing a dynamic buffer around the MACD zero line ?

Post Reply
RxCape
Trader
Posts: 68
Joined: Sun Mar 04, 2012 8:10 pm

Establishing a dynamic buffer around the MACD zero line ?

Post by RxCape »

Coders:

I am testing TallCoolOne's D1 Trend / 1H entry EA on shorter timeframes. I am posting this question here so I do not pollute his thread with questions on shorter timeframes.

On the shorter timeframes, I am finding that conditions still exist for the EA to take a trade, even though the MACD histogram is quickly approaching the zero line, indicating a weakening trend. Typically, this situation results in a stop loss of the trade. I have been noodling with the idea of establishing a buffer zone around the zero line so that if the MACD histo is within this buffer zone, the EA considers price action to be ranging and does not trade. I am able to edit the code to establish a fixed buffer zone rather than just above / below zero. For example, if MACD > 0.0004 or MACD< -0.0004 to establish a ranging trend. However, this fixed number may not be appropriate at all times and it certainly seems to be different for each pair. Attached is screenshot with a crude attempt at illustrating the zone.

I was wondering if there is a way to establish a dynamic buffer zone based upon the range of the histogram over the last XXX bars.

My simple mind was considering some % of the recent range as the buffer zone. Does this make sense? is it possible to interrogate the MACD indicator for the range of the histogram over some period of time?

Alternately, I have considered replacing the MACD with the Schaff Trend Cycle indicator because it essentially a MACD that indicates trend changes much sooner than MACD. However, that would be changing the strategy / method a bit too much.

Thanks for any help you can provide.
You do not have the required permissions to view the files attached to this post.
phil_trade

Re: Establishing a dynamic buffer around the MACD zero line

Post by phil_trade »

My simple mind was considering some % of the recent range as the buffer zone. Does this make sense? is it possible to interrogate the MACD indicator for the range of the histogram over some period of time?
of course, with the Shift parameter of iMACD() you can loop back x bars and do some calculation.

Philippe
Post Reply

Return to “Coders Hangout”