Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1064

 
Oleg Kolesov:
Hello! In the article "How to properly submit a product to the market" only 1 EX5-EX4 file is specified?Question? Advisor based on indicator, calculations in indicator file in advisor function iCustom(2 files), how to submit to market? Service Desk will not answer for 3 days?
Connect indicators to EA as resources
 
Artem thanks for the answer, how do I do it? There is an indicator file, there is an EA file with iCustom function. Is the file to be included?
 
Oleg Kolesov:
Artem thanks for the reply, how do I do it? There is an indicator file, there is an Expert Advisor file with iCustom function. Is there a file to be included?

Don't scatter your questions over different forum threads - it will be easier for everyone:

Forum on trading, automated trading systems and testing trading strategies

Any questions from newbies on MQL4 and MQL5, help and discussion on algorithms and codes

Igor Makanu, 2019.06.13 18:09

You were answered in the MQL5 questions thread - enable indicator as a resource, don't know how - start by searching the site "resource"

https://docs.mql4.com/ru/runtime/resources

Service Desk deals with financial matters, not training

Документация по MQL5: Программы MQL5 / Ресурсы
Документация по MQL5: Программы MQL5 / Ресурсы
  • www.mql5.com
В данном примере показано как проигрывать звуки из файлов Ok.wav и timeoit.wav, входящих в стандартную поставку терминала. Эти файлы находятся в папке означает папку, из которой запущен клиентский терминал MetaTrader 5.  Программным путем из mql5-программы каталог терминала можно узнать следующим образом: Расположение каталога данных терминала...
 

I understand the dialogue here. The MQL is big! I have to read it. Thanks for the help.

 
Good afternoon. Question about MT5 genetic testing algorithm. After stopping testing (e.g. to reboot the PC) the results of the runs remain, but the number of runs left to complete the test goes back to the original. It starts all over again, but with the results already in place? The description of the algorithm states that stopping will not affect the test, but when restarting (no EA changes, no recompilation) it seems to start all over again. How should this be perceived? Thanks already.
 

couldn't google or solve an elementary problem (((.

there is a position holding time in seconds, i need to get time as hour + minutes + seconds , ( how to convert everything to days/months/hours/minutes/secondshttps://www.mql5.com/ru/code/353 - not what i need. don't need days and months, need only hours even 1000 h)

The truth is in here somewhere, but minutes is getting a lot!

void OnStart()
  {
   int timeinsec=100000;
   int h,m,s;
   SecondsToHMS(timeinsec,h,m,s);
   printf("h = %d , m = %d , s = %d",h,m,s);
  }
//+------------------------------------------------------------------+
void SecondsToHMS(int seconds,int &hour,int &min,int &sec)
  {
   hour= int(seconds/3600);
   sec = seconds - (hour * 3600);
   min = int(seconds / 60);
   sec = seconds - (min * 60);
  }
//+------------------------------------------------------------------+
2019.06.18 10:22:48.245 tst EURUSD,H1: h = 27 , m = 1666 , s = 40
 
Igor Makanu:

I get a lot of minutes!

You don't use the updated number of seconds when calculating the minutes.

 

Hello, I want to make an alert on the condition that the maximum of the first candle is equal to the maximum of the second candle. That is, not exactly equal to, but about, a margin of error of 5 points. Help.

  {
//---
   if(rates_total<3) return(0);
   int limit=rates_total-prev_calculated;
   if(limit>1)
     {
      limit=rates_total-3;
      ArrayInitialize(BufferUP,EMPTY_VALUE);
      ArrayInitialize(BufferDN,EMPTY_VALUE);
     }
   for(int i=limit; i>=0; i--)
     {
      if (fabs(high[i+1]-high[i+2]) <= 5.0*_Point)

        {
         BufferDN[i+1]=high[i+1];
        }
     }
//--- return value of prev_calculated for next call

   return(rates_total);
  }

 
yiduwi:

That is not exactly equal, but approximately, a margin of error of 5 points.

if (fabs(high[i+1]-high[i+2]) <= 5.0*_Point)

fxsaber:

You are not using the updated number of seconds when calculating the minutes.

Thanks, that's one of the errors, but still can't figure out how to get from 159,002 seconds 44 hours 10 minutes 2 seconds (online calculator )) )


here's the solution but i think i'm missing something

//+------------------------------------------------------------------+
void OnStart()
  {
   int timeinsec=159002;
   int h,m,s;
   SecondsToHMS(timeinsec,h,m,s);
   printf("h = %d , m = %d , s = %d",h,m,s);
  }
//+------------------------------------------------------------------+
void SecondsToHMS(int seconds,int &hour,int &min,int &sec)
  {
   int s=seconds;
   sec = s%60;
   s-=sec;
   Print("s = ",s);
   min = int(s / 60)%60;
   hour= int(s/3600);
  }
//+------------------------------------------------------------------+
2019.06.18 11:46:22.691 tstss EURUSD,H1: h = 44 , m = 10 , s = 2
 
Igor Makanu:

Thank you. Can you tell me why the arrow is on the second bar and not on the first.

      if (fabs(high[i+1]-high[i+2]) <= 0.0*_Point)
        {
         BufferDN[i+1]=high[i+1];
        }
Reason: