Questions from Beginners MQL5 MT5 MetaTrader 5 - page 668
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
And how, in my question, can OnTimer() be applied ?
Well, it's not for me to know what you'll be counting before the market opens)
For example like this:
void OnTimer() {
// Обрабатываем информацию независимо от работы рынка в функции DataProcessing
DataProcessing();
if(TimeCurrent()>starttime) { // если рынок работает
connection=true; // ставим флаг в положение "true"
... // или сразу обрабатываем весь остальной код, в основном - торгвый
}
}
void DataProcessing() {
// что-то делаем по таймеру
}
if(connection==true) { // или здесь торговые операции и остальной код, чтоб не в таймере
...
}
Well, it's not for me to know what you'll be counting before the market opens)
Apparently, the issue needs to "settle down". I may have to change the logic of the code architecture. "It's always better in the morning".
THANK YOU VERY MUCH again !!!!
Thank you Vitaly for your sincere attempts to help!!!!
Apparently, the issue needs to "settle down". I may have to change the logic of the code architecture. "It's always better in the morning".
Thanks a HUGE THANK YOU again !!!!
Try it this way, it will now be "0" - Sunday
Artyom, the question was about how to define the day off programmatically without resorting to TimeLocal(). ))
Seen, heard, read ;)
But you said that you need to calculate everything first, and then "out into the world". And you asked how a timer would help with that - so that's what your question suggested, not about defining a day off.
Try it this way, it will now be "0" - Sunday
Right!!! Returns "0". THANKS!!!!
And I've been looking to see what I can get back
Return codes of the trade server
Code
Constant
Description
132
ERR_MARKET_CLOSED
Market is closed
I wonder what else besides OrderSend() returns error 132 - market is closed?
nothing, just making a trade transaction
THANK YOU!!!!
)) In principle, that's quite enough!!!!
THANK YOU!!!!
Look here, at the end of the branch there is a primitive solution.
Allows you to get the start time and the end time of the specified quotation session for the specified symbol and day of the week.
string name, // имя символа
ENUM_DAY_OF_WEEK day_of_week, // день недели
uint session_index, // номер сессии
datetime& from, // время начала сессии
datetime& to // время окончания сессии
);
If data is received for the specified session, symbol and day of the week, returns true, otherwise returns false.
и
Allows you to get the start and end time of the specified trading session for the specified symbol and day of the week.
string name, // имя символа
ENUM_DAY_OF_WEEK day_of_week, // день недели
uint session_index, // номер сессии
datetime& from, // время начала сессии
datetime& to // время окончания сессии
);
If data is received for the specified session, symbol and day of the week, returns true, otherwise returns false.