Discussion of article "Better Programmer (Part 01): You must stop doing these 5 things to become successful MQL5 programmer" - page 2
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
Good article. The concept of what to do and what not to do is well explained.
Errors in specific examples in this case do not reduce the value of the article, as its task is to help people optimise their work style. This task is solved brilliantly, everything is written as simple and clear as possible.
Thank you, Omega!
Interesting...
Becoming a good programmer (part 1): getting rid of five habits to become a better MQL5 programmer
Interesting....
Interesting...
Becoming a good programmer (part 1): getting rid of five habits to become a better MQL5 programmer
This is freelancing, customers most often do not understand the code at all, and bad reviews are not for the quality of the code. I wrote it, the programme did not give profit, so here is the review.
A must read for everyone (and the author of the article even more so) : 97 Things Every Programmer Should Know
Variant working faster and in my opinion clearer:
1. the error in the loop initialisation is that 1 must be subtracted from the quantity when we do the backtracking.
2. If you could not get the position by the index from the library function, you need to exit the loop with an error and then if you need to process or repeat the function again, otherwise there is a risk of getting an unreliable amount, and you still work with finances, and sometimes there are large amounts in the position, and such a small thing can lead to a loss.
3. First you should check bool variables, then ENUM enumerations and only after that check int, double, string, if the check fails, then immediately go to the next element of the loop.
If you make comparison operations via &&, the programme will necessarily check each condition.
4. The name for the function is also important, it looks better PositionsByType, it seems like a trifle, but when you go to use this function you don't need to go to the library and its table of contents, but just start typing the standard name Positions, and you will have several options for calling PositionsTotal, PositionsByType.....
5. You need to respect the width of the code so that you don't use horizontal scrolling, as this greatly reduces readability and speed of development.
You are wrong about that:
Yes, you have corrected me correctly, the check will be performed up to the first false, the main thing is that small data types should be first.
In case the conditions consist of functions, the smallest one should be the first and up to the largest one from the point of view of consumed resources, but without breaking the programme logic...
I use this technique in all my projects, the speed gain is noticeable for a tester in optimisation mode.
This is freelancing, customers most often do not understand the code at all, and bad reviews are not for the quality of the code. You wrote it, the programme did not give you profit, that's the review.