Questions from Beginners MQL5 MT5 MetaTrader 5 - page 870

 
Sergey Savinkin:

I don't think it's about the code at all. Here is my PERIOD_CURRENT


Indeed, not in the code) inattention!

Thank you.

 
Folks, how to get from the variable datetime Input1=D'2018.05.25 06:12:18'; the number of seconds elapsed since 1970 in format (example 458855556, etc.)
 
Evgeniy Myznikov:
Folks, how to get from datetime variable Input1=D'2018.05.25 06:12:18'; the number of seconds elapsed since 1970 in format (example 458855556, etc.)

Convert to long:

long sec=(long)Input1;
 
Vladimir Karputov:

Convert to long:

How about a concrete example?

How do you get this into Comment(), can you give me a code example?

 
Evgeniy Myznikov:
Can you be more specific?

How do you get this into Comment(), can you give me a code example?

You can:

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property script_show_inputs
//---
input datetime Input1=0;
input datetime Input2=D'2018.05.25 06:12:18';
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
  {
   Comment("Input1: ",Input1,"\n",
           "Input2: ",Input2,"\n",
           "(long)Input1: ",(long)Input1,"\n",
           "(long)Input2: ",(long)Input2);
  }
//+------------------------------------------------------------------+


Result:


 
Vladimir Karputov:

You can:


Result:


Thank you.
 
Vladimir Karputov:

You can:


Result:


if ((long)Input1<(long)TimeCurrent()) Comment("Work");

Do these comparisons work well?

 
Can I download the entire MQL5 Handbook in one file?

I would like to print it out.
 
foga:
Can I download the whole MQL5 Hand book in one file?

Want to print

MQL5 Handbook->.


Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Документация по MQL5 - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
  • www.mql5.com
MetaQuotes Language 5 (MQL5) - язык программирования технических индикаторов, торговых роботов и вспомогательных приложений для автоматизации торговли на финансовых рынках. MQL5 является современным языком высокого уровня и разработан MetaQuotes Software Corp. для собственной торгово-информационной платформы. Синтаксис языка максимально близок...
 
Vladimir Karputov:

MQL5 Handbook->.


Thank you.

Ugh, 5598 pages. I don't want to print it out anymore )