1) Is the scope of structures the same as just variables?
Structures are one of the data types (composite data types). Therefore, it is better to talk about variables of structure type. The rules about scope apply equally to variables of simple types and structure types. So far I haven't seen any exceptions.
2)MqlRates structure. I want to find the last 10 extrema and therefore I do not know how much price data I will need. Shall I copy all available data? Isn't it resource consuming?
:) It all depends on the level of extremum. If an extremum is being searched for over the entire observation period, there is no way to get 10 items even if "to copy all available data".
Actually, it is not always necessary to use the predefinedMqlRates structure. In many cases, it is sufficient to create your own "light" structure (e.g., high-low) and work with variables of that type. I can't say anything about resource consumption, because I'm not interested in this question (I do without usingMqlRates structure).
Another one of my approaches to MQL5: I decided to use its capabilities to optimize Expert Advisors since MT4 allows me to optimize them within 24 hours, and the capabilities of multicore processors and agents are so dissimilar... However, before bothering with recoding "real" Expert Advisors, I decided to check what I will get. I have written a simple Expert Advisor with perseptron ala AI Reshetov, not even indicators to enter but simple close price difference, I have optimized it by H4 open prices, a year ago. CPU cores are all loaded, and agents seem to be working, and cloud is moving, but.... :Slower than in MT4 many times simply Why is everything so sad????
- 2010.03.16
- Denis Zyatkevich
- www.mql5.com
Another one of my approaches to MQL5: I decided to use its capabilities to optimize Expert Advisors since MT4 allows me to optimize them within 24 hours, and the capabilities of multicore processors and agents are so dissimilar... However, before bothering with recoding "real" Expert Advisors, I decided to check what I will get. I have written a simple Expert Advisor with perseptron ala AI Reshetov, not even indicators to enter but simple close price difference, I have optimized it by H4 open prices, a year ago. CPU cores are all loaded, and agents seem to be working, and cloud is moving, but.... :Slower than in MT4 many times simply Why is everything so sad????
Another one of my approaches to MQL5: I decided to use its capabilities to optimize Expert Advisors since MT4 allows me to optimize them within 24 hours, and the capabilities of multicore processors and agents are so dissimilar... However, before bothering with recoding "real" Expert Advisors, I decided to check what I will get. I have written a simple Expert Advisor with perseptron ala AI Reshetov, not even indicators to enter, but differences of close prices. I optimize it by H4 open prices, a year ago. CPU cores are loaded, and agents seem to be working, and cloud is moving, but.... :Slower than MT4 many times over Justwhy everything is so sad????
Probably because MQ4 and MQ5 files are not attached.
There are programmers here. It is improper to ask such questions without attaching the source code.
Probably because the MQ4 and MQ5 files are not attached.
There are programmers here. It is not good to ask such questions without the source code attached.
Renat:
MQ4?
And in MQ4 I just took ArtificialIntelligence.mq4 and attached it just in case, of course they are not identical, but they are almost equally time-consuming, at least simply due to their simplicity. But here's what we have:
On 8 cores in MT5 (disabled all agents):
2011/11/11 15:01:07 PM Statistics locals 13371 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)
2011.11.11 15:01:07 Statistics passed in 1 hours 07 minutes 51 seconds
Total: 4071/13371=0.3044 sec per pass.
On one core in MT4:
2011.11.11 15:17:40 There were 6345 passes done during optimization
2011 11/11/11 15:17:40 ArtificialIntelligence: optimization stopped, 2103 cache records were used, 2103 cache records rejected
2011.11.11 15:17:12 ArtificialIntelligence: optimization started
Total: 28/6345=0.0044129 sec per pass.
Two orders of magnitude . Both are genetics, EURUSD H4 open prices, interval from 1.01.11 till today, single computer, Win7 x64. What slows down the optimization in MT5 so much? Do I have such a critical error there????
Two orders of . Both are genetics, both are EURUSD H4 opening prices, interval 1.01.11 to today, same computer, Win7 x64. What is so slowing down the optimisation in MT5? Do I have such a critical error there????
What is the simulation type, 1 or 2?
What type of modelling, 1 or 2?
- www.mql5.com
I think I am beginning to understand what is going on here:
2011.11.11 16:11:37 Core 1 EURUSD,H4: 1271227 ticks (1344 bars) generated within 1326 ms (total bars in history 2904, total time 1372 ms)
Why are there so many ticks at opening prices? Moreover, if I put "OHLC on M1" model, the same thing happens:
2011.11.11 16:15:48 Core 1 EURUSD,H4: 1271227 ticks (1344 bars) generated within 2075 ms (total bars in history 2904, total time 2106 ms)
I double-checked it 10 times and with the first and second type of builds (from Rosh's picture) number of ticks does not change..... Imho not good, or I'm doing something wrong?
Build 527.
Z.I. Tested all the ticks:
2011/11/11 16:24:55 Core 1 EURUSD,H4: 18578763 ticks (1344 bars) generated within 24819 ms (total bars in history 2904, total time 25319 ms)
With the "all ticks" model there are only 14 times more ticks than with the "open prices" model on H4. Either I'm nuts, or one of two ... So the "opening price" model just doesn't exist?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Decided to create a topic similar to the existing one on the 4 forum, there's a popular trail to it). If it's repeated, kill it without regret.
Of course the theme is not just for fun. I decided to tackle MQL5 and several questions appeared at once:
1) is the scope of structures the same as that of simple variables?
2)MqlRates structure. I want to find the last 10 extrema and therefore I do not know how much price data I will need. Shall I copy all available data? Isn't it resource consuming?