Files: sadece_imacd_eklentisi.ex5 44 kb
If the code is not doing what you expect use the debugger, the how-to is here: https://www.mql5.com/en/articles/654
- www.mql5.com
Hi, Put some tracing lines in your code as I did below such as Alert(" ") and check if your conditions for MACD is working. You better test it on the strategy tester as a visual test.
bool SearchTradingSignals(void) { double macd[],msignal[]; ArraySetAsSeries(macd,true); ArraySetAsSeries(msignal,true); int start_pos=0,count=3; if(!iGetArray(handle_iMACD,MAIN_LINE,start_pos,count,macd) || !iGetArray(handle_iMACD,SIGNAL_LINE,start_pos,count,msignal)) return(false); //--- if(macd[0]>signal[0]) if(MathAbs(macd[0]-signal[0])>InpDifference) { m_need_close_all=true; Alert(" macd > signal "); } if(macd[0]<signal[0]) if(MathAbs(signal[0]-macd[0])>InpDifference) { Alert(" macd < signal "); m_need_close_all=true; } //--- return(true); }
Merhaba, Aşağıda yaptığım gibi Alert(" ") gibi bazı izleme satırlarını kodunuza koyun ve MACD koşullarınızın çalışıp çalışmadığını kontrol edin. Görsel bir test olarak strateji test cihazında test etseniz iyi olur.
Thank you very much for your help. I wrote the alarm codes. I ran it while testing. but it did not alarm. and I don't know where to look for the alarm
1. The "MACD Difference -> Close All" parameter is specific for each timeframe and for each symbol.
2. Your function "SearchTradingSignals" is not called anywhere - this is a bug.
2. Your function "SearchTradingSignals" is not called anywhere - this is a bug.
why is this command not called? where is the problem?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I added the macd indicator to my robot. If the difference between the signal line and the man line in the macd indicator is 0.005, I added a position closing condition. no eror. but the function I want is not working. Can you show me where is the error? Robot codes are attached.
<ex5 file deleted>