Questions from Beginners MQL5 MT5 MetaTrader 5 - page 131

 
Sergey5:
but there is only one line and how to write this period in it?

in this line each character represents an hour in a day (0 character - 0 hour, ..., 23 character - 23 hour).

there are a total of 24 characters.

if symbol=0, the hour is not used, if =1, it is used.


 
sergeev:

in this line each character represents an hour in a day (0 character - 0 hour, ..., 23 character - 23 hour).

there are a total of 24 characters.

If symbol=0, the hour is not used, if =1, it is used.


Only 8 digits can be entered there.

But I think I found a description.

It's a bit convoluted, of course. Calculating time via engineering calculator...........

https://www.mql5.com/ru/forum/3775/page2

 
Can you advise how to debug an EA at the weekend? Maybe it's possible to set a time period and send quotes (from the history) independently, prescribing it in the code?
 
vovak_85:
Can you advise how to debug an EA at the weekend? Maybe it is possible to set a time period and feed quotes (from history) independently, prescribing it in the code?
Timer event
 
Silent:
event Timer
void OnTimer()
{

}

I am writing something wrong...can you write it how it should be?

 
vovak_85:
void OnTimer()
{
bool EventSetTimer(1);

}

I'm writing something wrong...can you write it how it should be?

I've done it in an indicator, have a look at it.

First you start the timer

EventSetTimer(1);

then catch the event

void OnTimer()
  {
// ваш код
    if() {};
  }

PS timer can be millisecond.

EventSetMillisecondTimer
 
Silent:

I've done this in an indicator, take a look.

First you start the timer.

then you catch the event.

Thanks, I'll look into it.
 
vovak_85:
void OnTimer()
{
bool EventSetTimer(1);

}

I am writing something wrong...can you write it how it should be?

EventSetTimer(1); is called in OnInit

In OnTimer it already catches the event which is generated with timer frequency.

In OnDeinit the timer is removed by EventKillTimer.

You can use other variants, but it's too early to get to this level :)

 
Sergey5:

Fellow experts.

Help for a newcomer.

What numbers to enter in this field to trade only from 08 to 20 hours.

11110000000000000111111b=> 31457535 (decimal number)

prohibition of trading from 00 to 07 hours

trading hours from 08 to 20 hours

prohibition from 21 to 23 hours

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о запущенной MQL5-программе
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация о запущенной MQL5-программе
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация о запущенной MQL5-программе - Документация по MQL5
 
Hello, I am new here, I downloadedthe MetaTrader 5 Strategy Tester Agent and I cannot activate it, in the initial tab there is no option "Allow to participate in the network..." what to do? Please advise me.


Reason: