Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1265

 
dr.mr.mom:

Expert handles events. If you don't want to wait for the NewTick# event, that is handled by theOnTick function, you can use

boolEventSetTimer(
int seconds// number of seconds
);

to generatetimereventswith specified periodicity, the Timer# event is handled by OnTimer() function. Your Expert Advisor will work continuously (with some periodicity) without waiting for the ticks, and you decide what it will do.

Once again - I need to check the trading time in OnTimer event or not.

 
Opened a demo account, connected to a paid signal. Can I do this? Connect a demo account to real signals for autotracking?
 
Finansiallogin1:
Opened a demo account, connected to a paid signal. Is it possible to do so? Connect a demo account to real signals for autotracking?

For money, I guess anything is possible.)))

 
Andrey Sokolov:

Once again - I need to check whether the time is trading or not in the OnInit event.

The identifier, trading or non-trading time most likely does not exist, based on the set and purpose of the standard functions OnTick, OnTimer and others. And what prevents the calendar from being programmed, the beginnings of the exchanges are known. Although I don't understand the idea. OnTick is already triggered on the first tick. Between sessions, which it is clear when they will be, you can make expensive calculations, tied to real time.

 
Valeriy Yastremskiy:

There is probably no identifier, trading or non-trading time, based on the set and purpose of the standard OnTick, OnTimer and other functions. And what prevents a calendar from being programmed, the beginnings of the exchanges are known. Although I don't understand the idea. OnTick is already triggered on the first tick. In between sessions, which it is clear when they will be, you can make expensive calculations in real time.

here's

 
Andrey Sokolov:

here's

What do you mean it started working, if it's attached to a chart it's working. The task is not clear. If before the first tick five minutes before the start of the session, OnTimer. And if before the first tick if OnTick works, then why? From the end of the trading time and at the start, what changes?

Zy noticed. An oninit event? Is that when you're hand-drawn? Time between ticks, that's all that comes to mind. If more than 120 seconds, it is unlikely a trading event. But it's better to ask your broker or brokerage company if there is an identifier of trading time.
 
Andrey Sokolov:

here's

No tick - no price, it means that the time is not trading.

It happens during holidays, during rollover and some other factors, for example force majeure, when a quote and trade time is 00:01 -> 23:59 in instrument specification, but real ticks start to come in at 00:03.

What to do during those 2 minutes? Trade? How will you trade if the time is trading but there are no quotes and no trade!

Документация по MQL5: Константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Для получения текущей рыночной информации служат функции SymbolInfoInteger(), SymbolInfoDouble() и SymbolInfoString(). В качестве второго параметра этих функций допустимо передавать один из идентификаторов из перечислений ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE и ENUM_SYMBOL_INFO_STRING соответственно. Некоторые символы (как правило...
 
Vitaly Muzichenko:

No tick - no price, it means that the time is not trading.

It happens during holidays, during rollover and some other factors, for example, force majeure, when a quote and trade time is 00:01 -> 23:59, but real ticks start to arrive at 00:03.

What to do during those 2 minutes? Trade? How will you trade if the time is trading but there are no quotes and no trade!

SYMBOL_START_TIME

I understand this is for the current session, the time and date of the start and end of the trading session.

By the way, for the trading time, if the time is inside, you can use it as an identifier. But whether it can be used at non-trading time, I have not understood. I have to try it).

 
Valeriy Yastremskiy:

I understand this is for the current session, the time and date of the start and end of the trading session.

For trading time by the way, if the time is inside, it can be used as an identifier. But whether it is possible to use them at non-trading time, I have not understood. We have to try it).

It did not work - I tried it. Everything only works from the tick and its time

 
Vitaly Muzichenko:

No tick - no price, it means that the time is not trading.

It happens during holidays, during rollover and some other factors, for example, force majeure, when a quote and trade time is 00:01 -> 23:59, but real ticks start to arrive at 00:03.

What to do during those 2 minutes? Trade? How will you trade if the time is trading but there are no quotes and no trade!

THE SYMBOL_START_TIME

There are also ticks during the quote session, EA even sends orders but in response -> market is closed. did not findthe sessionID, but it is easier to limit the trading time as Valeri said above

Reason: