Questions from a "dummy" - page 22

 
Interesting:

The current time is the second date (it should be clear from the help)...

It will probably work like this

It does work)). Hmmm... I must have misunderstood something here:

The elements from the starting position are counted from the present to the past, i.e. a starting position equal to 0 means the current bar.

So I'm bubbling over)))

 
Please advise which MQL4 analog of Day() and Hour() functions is there in MQL5(the return value should be int)?
 
Cmu4:
Can you please tell me which MQL4 analog of Day() and Hour() function is there in MQL5(the return values should be int)?

https://www.mql5.com/ru/docs/dateandtime

all that is known to science so far.

Документация по MQL5: Дата и время
Документация по MQL5: Дата и время
  • www.mql5.com
Дата и время - Документация по MQL5
 
sergeev:

https://www.mql5.com/ru/docs/dateandtime

all that is known to science to this day.

It's a pity that there are no ready-made solutions, we'll have to make all sorts of twists with arrays anddatetime data again...Seemingly elementary things... why did they have to be removed when switching from MQL4?
 

Question on MessageBox. In the help

Примечание
Функцию нельзя вызывать из пользовательских индикаторов, так как индикаторы выполняются в интерфейсном потоке и не должны его тормозить.

writing in the script

void OnStart()
  {
   int  MessageBox(
                   string  text="text",// текст сообщения
                   string  caption=NULL,     // заголовок окна
                   int     flags=MB_YESNO    // определяет набор кнопок в окне
                   );
  }

I get .

'MessageBox' - function can be declared only in the global scope

I put it before OnStart() - no errors, no window either.

How to use this box correctly, handling YES/NO, for example (agree = continue script execution or refuse = abort).

 
 int  MessageBox(

why did you put int ?

to fight the compiler?

 
sergeev:

why did you put int ?

to fight the compiler?

That's an oops... :) Thanks, everything works.
 
   int MB=MessageBox(
                     "text01",// текст сообщения
                     NULL,// заголовок окна
                     0x00000004);
   if(MB==IDYES)
     {
      Print("YES");
      Alert("YES");
      Comment("YES");
     }
   else if(MB==IDNO)
     {
      Print("NO");
      Alert("NO");
      Comment("NO");
     }

Print stubbornly prints 2 at a time, what is it?

And another question. Is there any way to clear the oldAlertlist? I don't think there was one in 4. I could be wrong, haven't used it.

 
SymbolSelect("GBPUSD",false);
Doesn't remove the pair in the market overview. And does not add if true and it is not in the symbol list. Does not return an error. No open charts or positions on the symbol.
 
Silent:

Print stubbornly prints 2 at a time, what is it?

Alert also prints text for history.


And another question. Is there any way to clear the oldAlertlist? I don't think there was one in 4. I could be wrong, haven't used it.

Not yet.
Reason: