-
So copy the «DataFolder»/indicators/macd.mqx and change the code. What's the problem?
-
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
No free help (2017)Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help (2017)
-
So copy the «DataFolder»/indicators/macd.mqx and change the code. What's the problem?
-
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
No free help (2017)Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help (2017)
The problem is that I am not sure how to change it I have tried, your a genius bro obviously I am having a problem if I posted this question. Yes I have stated a problem "
Getting the MACD with EMA signal line MQL4", is the problem.
I do not see the area to change to MODE_EMA
<Deleted>
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor - CodeBerries #: I do not see the area to change to MODE_EMA
You don't see MODE_SMA either. You should look harder.
CodeBerries: the signal line is in SMA I need to change it to EMASimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
You don't see MODE_SMA either. You should look harder.
Wow you are like my second pair of eyes bro WOW! I did not see MODE_SMA!, genius. I did not understand how to change it is there a separate file that I can't see. Are you a mod? This is a forum that is your opinion (no free code), some people may choose to answer and help with the question as I would. You come off as a very anal person lol. You have not helped with anything yet lol.
If i knew how to solve the code question I would not be asking in the forum, "So copy the «DataFolder»/indicators/macd.mqx and change the code. What's the problem?"
- www.mql5.com
You have already been shown what to do (see below) ... replace the function "SimpleMAOnBuffer" which calculates the SMA, for the function that calculates the EMA.
EDIT: Here is a hint ... if it is not "Simple" then it is "Exponential". How difficult is that?
All those moving average functions are conveniently located in the include file "MovingAverages.mqh".
Please show some effort, given that you are claim to be 3rd year computer science student (from private message).
Forum on trading, automated trading systems and testing trading strategies
Getting the MACD with EMA signal line MQL4
William Roeder, 2022.09.29 01:03
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages EditorYou don't see MODE_SMA either. You should look harder.
SimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
You have already been shown what to do (see below) ... replace the function "SimpleMAOnBuffer" which calculates the SMA, for the function that calculates the EMA.
EDIT: Here is a hint ... if it is not "Simple" then it is "Exponential". How difficult is that?
All those moving average functions are conveniently located in the include file "MovingAverages.mqh".
Please show some effort, given that you are claim to be 3rd year computer science student (from private message).
Alright I will give it another go thanks.
You have already been shown what to do (see below) ... replace the function "SimpleMAOnBuffer" which calculates the SMA, for the function that calculates the EMA.
EDIT: Here is a hint ... if it is not "Simple" then it is "Exponential". How difficult is that?
All those moving average functions are conveniently located in the include file "MovingAverages.mqh".
Please show some effort, given that you are claim to be 3rd year computer science student (from private message).
I think I have fixed it but I am not sure if it is correct can anyone confirm thanks. I went into the MACD.mq4 file and then opened the MovingAverages.mqh file from within
then I changed to
int ExponentialMAOnBuffer(const int rates_total,const int prev_calculated,const int begin, const int period,const double& price[],double& buffer[]) //from int SimpleMAOnBuffer(const int rates_total,const int prev_calculated,const int begin, const int period,const double& price[],double& buffer[]) //in ExponentialMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer); //the updated code line //was SimplelMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi I have read in this thread that the mt4 macd is actually not the same MACD as for example tradingview and other sources, the 12, 26, 9 period is ema(12), ema(26) and sma(9). How can I change the signal line to a 9 ema, the bar lags compared to the ema MACD. Also I have looked at the default MACD script in mt4 and it doesn't let me directly change it to ema?
Here is a link to the thread with an explaination of what I mean, the signal line is in SMA I need to change it to EMA as it is at least 1 candle slower compared to the ema macd (this can be seen on tradingview).
https://www.mql5.com/en/forum/215471#:~:text=Calculating%20Signal%20Line%20of%20MACD,to%20be%20based%20on%20MACD.
Calculation (on MetaTrader)
The MACD is calculated by subtracting the value of a 26-period exponential moving average from a 12-period exponential moving average. A 9-period dotted simple moving average of the MACD (the signal line) is then plotted on top of the MACD.
Where:
Help would be appreciated thanks.