Questions from Beginners MQL5 MT5 MetaTrader 5 - page 130

 

Good afternoon.

Usingthe MQL5 Wizard, I made an Expert Advisor withthe IntradayTimeFilterfunction(SignalITF.mgh).

There isan option toallow (disallow) trading time defined in hours:

"BadHoursOfDay".

In the help it says:

"Bit field, each bit of which corresponds to one hour in a day (0 bits - 0 hour, ..., 23 bits - 23 hour). If the bit value is 0, trading signals are enabled for the corresponding hour. If the bit value is 1, trading signals are not allowed during the corresponding hour. The specified number is represented as a binary number and is used as a bitmask.

Prohibited clocks have priority over allowed clocks."

Can you please tell me in plain language, without slang, how to set the allowed hours from 08h to 20h?

Мастер MQL5: Создание эксперта без программирования
Мастер MQL5: Создание эксперта без программирования
  • 2010.12.15
  • MetaQuotes Software Corp.
  • www.mql5.com
Вы хотите быстро проверить торговую идею, не тратя времени на программирование? Выберите в "Мастере MQL5" нужный тип торговых сигналов, подключите модули сопровождения позиций и управления капиталом - на этом вся работа закончена. Создайте свои реализации модулей или закажите их через сервис "Работа" - и комбинируйте новые модули с уже существующими.
Files:
888.mq5  11 kb
 
Sergey5:
"A bit field, each bit of which corresponds to an hour in a day (0 bits are 0 hours, ..., 23 bits are 23 hours). If the bit value is 0, trading signals are enabled for the corresponding hour. If the bit value is 1, trading signals are not allowed during the corresponding hour. The specified number is represented as a binary number and is used as a bitmask.

Prohibited hours have priority over permitted hours."

Can you please tell me in plain language, without any slang, how to set the allowed hours from 08 hours to 20 hours?

for starters - do you know what a bit and a byte are? (believe me, this is not slang)
 
sergeev:
for a start - do you know what a bit and a byte are? (believe me, this is not slang)
is this a rhetorical question?)
 
Sergey5:
is that a rhetorical question?)
No, it's a question so that I know what words to use to explain the meaning of the bitmask (believe me, it's not slang)
 
sergeev:
no, this is a question for me to understand what words to use to explain the meaning of the bitmask to you (trust me, this is not slang)

I would like to keep it simple - in the compiled EA in the "Parameters" section you have to set theBadHoursOfDay variable to the values that determine the trading hours.

I tried to set different numbers and the test shows that there is no trading at certain hours.

But I can't figure out how to set the required times correctly.

 

Fellow experts.

Help for a newcomer.

What numbers to enter in this field, so that the trade is only conducted from 08 to 20 hours.

 
Sergey5:

Fellow experts.

Help for a newcomer.

What numbers to enter in this field, so that the trade is only conducted from 08 to 20 hours.

If the bit value is 0, trading signals are allowed in the corresponding hour. If the bit value is 1, trading signals are prohibited in the corresponding hour.
 
Sergey5:

Fellow experts.

Help for a newcomer.

What numbers to enter in this field, so that trading will only take place between 08:00 and 20:00.

Why don't you ask the author of the code? He knows exactly what to do...

 
sergeev:
If the value of this bit is 0, trading signals are allowed in the corresponding hour. If the bit value is 1, trading signals are not allowed in the corresponding hour.
But there is only one line and how do I write this period in it?
 
DC2008:

Why don't you ask the author of the code? He knows exactly what's what...

This is from the MKL5 Wizard builder, standard modules.