Questions from Beginners MQL5 MT5 MetaTrader 5 - page 186

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 "quite a lot of calculations based on history" add up to a dynamic array?
There is such a thing, yes :) Well, more precisely, several dynamic arrays are used, but they're not supposed to grow to too big a size.
And about splitting in half - it doesn't seem to make much difference which segment to take and how many inputs it has. On average a day is handled in 2500-3500 ms, but a week has to wait a few minutes. Don't have a suitable log handy at the moment, can't be sure how much. But an order of magnitude more than 5x per day, and most of the time is spent on the last day or two. A month, on the other hand, can be left overnight and by morning it will probably still be hanging >.>
And about splitting it in half - it doesn't seem to make much difference which section to take and how many inputs it has.
I wonder if there's an article somewhere like "the most common reasons for EA sluggishness"? I'm trying to understand why the Expert Advisor in the Strategy Tester is flying at the beginning but slows down further. It is not on the stage of development for it to be that critical (the speed is enough for development of basic mechanisms and tools). But it's still inconvenient that segments longer than a week don't make sense, because after that the speed already tends to zero.
Try putting a barrel of paint on its wheels and sliding it behind you as needed.
https://www.mql5.com/ru/forum/14041/page3#comment_605412
Try putting the paint barrel on its wheels and sliding it behind you as needed.
https://www.mql5.com/ru/forum/14041/page3#comment_605412
It's an entertaining parable :) Thanks for the tip. All that remains is to find the barrel... Or rather barrels. However, I already have a vague suspicion of news and resistance levels handlers...
Most often such a barrel is "the beginning of times" - own trading history (or some other accumulated information) an Expert Advisor tries to reanalyze at every bar (tick).
О! Surprisingly enough, the problem was found and fixed in literally minutes. Indeed, the problem was in the trading history, which went over every tick. The function I inherited from the code a la "the simplest Expert Advisor for mql5" that was used in the beginning. It has somehow slipped my mind since then. It seems to be working, so I think - why bother with it... Obviously, I'd better look through the remnants of that code :) Just in case someone Googled here with similar lags, I'll post the problematic fragment and my creative work on the subject in an attempt to solve this problem. I don't know how much more "correct" my version is in relation to the source. Most likely it's exactly the same shitty code as everything else I write. [I, of course, don't care. I mean, if someone will think to use the bottom piece: take into account that author is a self-taught shitcoder. ^^] But at least nothing seems to be broken and robot is flying like a jet :) Well, compared to what it was, at least. Trial two months went by in about a minute, which is still a nice contrast to the original 6+ hours %)
Was:
Became:
Anyway, thanks for the help :) Without the tip, it probably wouldn't have occurred to me to look into those far dusty corners of the code for a long time yet...
О! Surprisingly enough, the problem was found and fixed in literally minutes. Indeed, the problem was in the trading history, which went over every tick. The function I inherited from the code a la "the simplest Expert Advisor for mql5" that was used in the beginning. It has somehow slipped my mind since then. It seems to be working, so I think - why bother with it... Obviously, I'd better look through the remnants of that code :) Just in case someone Googled here with similar lags, I'll post the problematic fragment and my creative work on the subject in an attempt to solve this problem. I don't know how much more "correct" my version is in relation to the source. Most likely it's exactly the same shitty code as everything else I write. [I, of course, don't care. I mean, if someone will think to use the bottom piece: take into account that author is a self-taught shitcoder. ^^] But at least nothing seems to be broken and robot is flying like a jet :) Well, compared to what it was, at least. Trial two months went by in about a minute, which is still a nice contrast to the original 6+ hours %)
Was:
Became:
Anyway, thanks for the help :) Without the tip, it probably wouldn't have occurred to me to look into those far dusty corners of the code for a long time yet...
Recently refocused on creating panels, so my question is. I am creating two labels OBJ_RECTANGLE_LABEL and OBJ_LABEL and don't know how to drag OBJ_RECTANGLE_LABEL on graphic so that OBJ_LABEL is dragged exactly as one. Maybe there is a mechanism for binding them to each other and an action on one will cause the same action on the other (all the others)?
There is no such mechanism. You'll have to create one by yourself. Luckily it's not that hard. But it will take some work.
Good luck.