Merging Standard MACD and Stochastic Indicators into one?? (Combined Code)

 

Hello,

I'm hoping to find some help here. I've been researching and trying to figure out how to combine two indicators MACD and Stochastic Oscillator into one indicator but haven't had any luck. I'm not looking to overlay them on top of each other in the MT4 chart window but actually combine the code of each of them into one new indicator (See attached Image). No special additions are needed with the indicator, using the standard MACD and Stochastic that is automatically loaded into the MT4 platform would suffice. I'm wanting to enhance my current EA by adding the new indicator but don't have any coding experience. Is this something that has already been done or can anybody point me in the direction of how to accomplish this? Thank you!



 

Different range of values - not possible

You would see the macd as a flat line if they were to use same space (and same range of values)

 
roostermanusmc:

Hello,

I'm hoping to find some help here. I've been researching and trying to figure out how to combine two indicators MACD and Stochastic Oscillator into one indicator but haven't had any luck. I'm not looking to overlay them on top of each other in the MT4 chart window but actually combine the code of each of them into one new indicator (See attached Image). No special additions are needed with the indicator, using the standard MACD and Stochastic that is automatically loaded into the MT4 platform would suffice. I'm wanting to enhance my current EA by adding the new indicator but don't have any coding experience. Is this something that has already been done or can anybody point me in the direction of how to accomplish this? Thank you!



You are not "looking to overlay them..." but your picture is exactly showing an overlay. So what you really want is not clear, at least to me.
 
Alain Verleyen:
You are not "looking to overlay them..." but your picture is exactly showing an overlay. So what you really want is not clear, at least to me.
I'm looking to create an EA that executes a buy entry when the MACD histogram is below its 0 line and also the 20 Stochastic line, then the K% line of stochastic crosses above the MACD Signal line and a trade is opened. Vice versa for a sell entry. Is this possible or a pipe dream? 
 
roostermanusmc:
I'm looking to create an EA that executes a buy entry when the MACD histogram is below its 0 line and also the 20 Stochastic line, then the K% line of stochastic crosses above the MACD Signal line and a trade is opened. Vice versa for a sell entry. Is this possible or a pipe dream? 

if you are creating an EA, it's possible by calculating it's value.
if you tried to visualize it (by creating an indicator), it's not possible.

 
roostermanusmc:
I'm looking to create an EA that executes a buy entry when the MACD histogram is below its 0 line and also the 20 Stochastic line, then the K% line of stochastic crosses above the MACD Signal line and a trade is opened. Vice versa for a sell entry. Is this possible or a pipe dream? 

Rakic above was right: it is impossible to do what you want to do. It cannot be done. 

Why? Because the Stochastic runs ONLY from zero to 100 while the MACD runs from minus infinity to plus infinity. You cannot do the two together. 

When you first set up the Stochastic and then overlay the MACD on top of it, then the MACD floats up and down and all over the place all the time while the Stochastic simply stays fixed between zero and 100. 

That´s it. You cannot do it. 

I know what you are trying to do.

What you are saying: "then the K% line of stochastic crosses above the MACD Signal line is impossible. When the MACD floats up and down all the time, you cannot have that statement. It is impossible with an up and down floating MACD.

You better read this quickly and make a printscreen. The moderator will delete it very quickly because I am writing it to you. I wrote another relevant comment. It was immediately deleted. Immediately make a print screen then you can read this comment in your own time. 

 
PennySeven:
...

You better read this quickly and make a printscreen. The moderator will delete it very quickly because I am writing it to you. I wrote another relevant comment. It was immediately deleted. Immediately make a print screen then you can read this comment in your own time. 

Off topic comments are removed (yes it's me who decide). It has nothing to do with you.

Useful comment as you just posted are welcome. Your continuous whingeing are not.

 
Mohamad Zulhairi Baba:

if you are creating an EA, it's possible by calculating it's value.
if you tried to visualize it (by creating an indicator), it's not possible.

Yes, you can do it in code, but not visually in an overlay. 

 

@roostermanusmc 

I know some time has passed since you first asked the question bout the possibility of combining the stochastic and macd indicators into one. I have recently been researching it and came across your post here, assuming that I could not be the first person to pursue such a query. I too have noticed that when I overlay the stochastic on the macd, when the macd signal line crosses the stoch lines in the overbought zone, it looks like it results in a sell signal, and vice-versa when in the oversold zone. The problem is when I adjust the screen in any way the lines also move because the two indicators adjust according to their preset values. I disagree with PennySeven about the macd having a value of infinity to negative infinity however. I think that the preset values of each can be interpolated and transposed on top of one another as fixed points because both have a crossing line. If that line is used as a basis, then the various measurement points of one can be fixed onto the other. That way, you should not only be able to receive alerts when the conditions you're seeking are met, you should also be able to see them just fine  on your screen in the indicator window. I'm not a coder either, but I'm trying to get connected with someone who can, unless you've found a solution already?

Reason: