no error but not working

 

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>

 
Kutluhan Yesilkaya: 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.
Files: sadece_imacd_eklentisi.ex5  44 kb
No one can show you anything if all you provide is an executable instead of source code.
 
Fernando Carreiro # : Sağladığınız tek şey kodu yerine bir yürütülebilir dosyaysa, herhangi bir beden gösteremez.

codes not working?

 
Kutluhan Yesilkaya #:

codes not working?

If the code is not doing what you expect use the debugger, the how-to is here: https://www.mql5.com/en/articles/654

Debugging MQL5 Programs
Debugging MQL5 Programs
  • www.mql5.com
This article is intended primarily for the programmers who have already learned the language but have not fully mastered the program development yet. It reveals some debugging techniques and presents a combined experience of the author and many other programmers.
 
Kutluhan Yesilkaya #:

codes not working?

You should provide the source file "sadece_imacd_eklentisi.mq5" file not the " sadece_imacd_eklentis .ex5". No one can see what's inside .ex5 files.
 
71 TL # : "sadece_imacd_eklentisi.mq5" değil, sadece_imacd_eklentisi.mq5" hayatta sağlamalısınız. .ex5 ortamın içinde ne olduğunu göremez.

mq5 files

 
Kutluhan Yesilkaya #:

mq5 files

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);
  }
 
71 AED # :

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

 
Kutluhan Yesilkaya #:

mq5 files

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.

 
Vladimir Karputov #:

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?

 
Kutluhan Yesilkaya #:

2. Your function "SearchTradingSignals" is not called anywhere - this is a bug. 


why is this command not called? where is the problem?

This question should be addressed to you - you forgot to write a call to the "SearchTradingSignals" function.