Sorry for not updating long. I've been having a tough time with my life lately. A lot of things going on, and the only constants I'm having right now is change! So, here I am again. I'm trying to put things together so we can continue to achieve financial freedom with our own build EA.
I have put up some codes from our previous project. I have removed the MACD indicators and replace it with Moving Averages.
I myself is more comfortable playing with Moving Averages crossing instead of reading the original MACD idea from the MACD Sample.mq4 provided by Meta Trader 4.
So, here we go again. Have a look at the screenshot below to find out how I modified them.
External variable has been removed and replaced with Fast EMA and Slow EMA.
And here is where you remove the MACD indicators. Replace them with 4 moving averages. Now, some might ask why there is 4 moving averages instead of 2. Here, let me tell you, EA does not read the lines. Instead, it need numbers in order to form an actual logic. For example EMA8 crosses EMA20 from below, normally we see this as an uptrend. EA will have to interpret it as current EMA8 is higher than EMA20, whereas previous bar it was EMA20 higher than EMA8. Therefore, we need 4 variable to hold the correct value of a MA cross.
The above screenshot is changing the trading condition from MACD to Moving Averages cross. Let's have the last screenshot in changing the closing trades condition. It's simple, just change buy to sell and sell to buy from the closing trade condition.