Discussion of article "MQL5 Cookbook - Multi-Currency Expert Advisor and Working with Pending Orders in MQL5"
Time.
Hours are not always enough, minutes are also necessary. For example, if the market opens and closes at fractional times.
And this function raises questions - you need to trade through midnight much more often than you need minutes
bool IsInTradeTimeRange(int symbol_number) { //--- If time range trading is enabled if(TradeInTimeRange[symbol_number]) { //--- Date and time structure MqlDateTime last_date; //--- Get the latest date and time data TimeTradeServer(last_date); //--- Outside the authorised time range if(last_date.hour<StartTrade[symbol_number] || last_date.hour>=EndTrade[symbol_number]) return(false); } //--- In the permitted time range return(true); }
Time.
Hours are not always enough, minutes are also necessary. For example, if the market opens and closes at fractional times.
And this function raises questions - you need to trade through midnight much more often than minutes.
Yes, I agree. I'll try to visualise it later, in some new scheme.
Then perhaps instead of enumerations we should make a line where the user specifies the time himself. For example:"9: 35". Otherwise the list of parameters is extended by three more parameters (in the article scheme) for specifying minutes.
It would be great if there was a convenient standard possibility to specify the time. Now we have datetime, we need to make time. )
In fact, it's all program code, IMHO it's not suitable as an article, rather it's for the Code Base section.
In fact, it's all program code, IMHO it doesn't work as an article, rather it's for the Code Base section.
In fact, it's all program code, IMHO it doesn't work as an article, rather it's for the Code Base section.
Such articles are convenient for learning the language.
It is easier to read both text and code, and to look at illustrations at once, than to scroll through the article separately, and separate codes from different files.
But I agree that some descriptive part is missing. Concept and main points of implementation in the form of plain text.
Such articles are convenient for learning a language.
It is easier to read both text and code, and to look at illustrations at once, than to scroll through the article separately, and separate codes from different files.
But I agree that some descriptive part is missing. Concept and main points of implementation in the form of plain text.
This series of articles is more for sequential language learning. The scheme was described in one of the previous articles and probably there is no sense to describe everything again. At the beginning of the article there is a link to the article where this scheme was considered in detail. Additional functions were written here and some small changes were made. Everything is simple and nothing superfluous, and every line in the code is commented. I think it's nice to have a lot of different ready-made schemes that you can just pick up and use.
I can't imagine what else could have been added to the article. But that's okay. ))
Why is there so much code for several symbols?
To be able to test the system in the tester on several symbols at once.
Wouldn't it be simpler to put one Expert Advisor on different symbols, in my opinion it will be faster to execute programmes. In this connection, dear author, could you tell me how to convert this code so that it works only on one character, except for the way to put in the variable #define NUMBER_OF_SYMBOLS one?
If you want it to work on one character only, just remove all loops related to character search. From some functions you will then need to remove the first parameter of the character sequence number.
Also, arrays that were initialised with values of external parameters will no longer be needed. In the functions where they were used they will have to be replaced by variables of external parameters.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article MQL5 Cookbook - Multi-Currency Expert Advisor and Working with Pending Orders in MQL5 has been published:
This time we are going to create a multi-currency Expert Advisor with a trading algorithm based on work with the pending orders Buy Stop and Sell Stop. The pattern we are going to create will be designed for the intra-day trade/tests. The article considers the following matters:
Author: Anatoli Kazharski