Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 881

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
There is a need to hide objects according to a criterion. How can I hide objects on a graph (mainly lines)? The objects can be selected by prefix.
OBJPROP_TIMEFRAMES helps to do it. But not all in a bunch, but in a loop one by one.
OBJPROP_TIMEFRAMES would help with that. But not all in a bunch, but in a loop one at a time.
I will do so, I want a period-by-period mapping and will experiment, thanks for the advice.
How will the program run faster?
1. var.- if you write universal functions. In this case, the number of checks increases, but the amount of code decreases, because in the end there are fewer functions, less initialized variables, but there is a disadvantage mentioned earlier.
The 2nd variant is if we write more functions that will perform less complex calculations. In this case, the amount of code increases, more variables are initialized and the compiler will have to run code idly often to find the right function, but there is a plus, the number of checks decreases.
Who thinks about it?
How will the program run faster?
1. var.- if you write universal functions. In this case, the number of checks increases, but the amount of code decreases, because in the end there are fewer functions, less initialized variables, but there is a disadvantage mentioned earlier.
The 2nd variant is if we write more functions that will perform less complex calculations. In this case, the amount of code increases, more variables are initialized and the compiler will have to run code idly often to find the right function, but there is a plus, the number of checks decreases.
Who thinks about it?
Option 2, lots of small functions, but you're 2 months in the dark about the difference between compiler and interpreter, the compiler doesn't run code idly, it creates tables of links to functions, variables, constants... and then uses those tables to jump in at runtime
here readhttps://habr.com/ru/company/intel/blog/143446/
the developers wrote the same thing here somewhere search the threadhttps://www.mql5.com/ru/forum/304239/page36#comment_11049194
SZZ: here's how the compiler workshttps://habr.com/ru/sandbox/114988/
It's just amazing. How can you read documentation to see DRAW_HISTOGRAM2 and not see DRAW_COLOR_HISTOGRAM2
Oh, and there are extra buffers declared.Good evening. Tried for a long time and in vain. The histogram draws correctly, but the coloring in different colours (above and below level 50) has not won. Please tell me where I screwed up. Text below, file is linked.
Good evening. Tried for a long time and in vain. The histogram draws correctly, but the coloring in different colours (above and below level 50) has not won. Please tell me where I screwed up. Text below, file is linked.
In debug mode I was looking through the values step by step:
- ExtMainBuffer[i]
- cl
- ColorHistogram_2Buffer1[i]
- ColorHistogram_2Buffer2[i]
- ColorHistogram_2Colors[i]
It seems to get everything right, but the bar graphs are only green, those below 50 are not coloured red.In debug mode, looked through the values step by step:
In debug mode, looked through the values step by step:
but you're on the pull ...
Well that's understandable I just figuratively called the program a compiler, but in general in which case would it be better?