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

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
Yes indeed as much as 8 pieces, but the chart does not show that the price is 0 does not matter, the line still clings to the cursor (follows it)
Don't use ObjectDelete because the line runs away to "0" every time
betterObjectSetString(0,"line 1",OBJPROP_NAME,line_name); ObjectSetInteger(0,line_name,OBJPROP_COLOR,clrRed);
Don't use ObjectDelete because the line runs away to "0" every time
better0 means false. Anything not 0 istrue. But has anyone thought about readability of such code, where all kinds of conditions are mixed?
It is not a boolean value. But it can be easily turned into a boolean:
So the main thing is to have the right approach to code writing. Then you willnever have such problems.
I have the renaming option and yes it works. In the case of ObjectDelete() why green and red lines are created in one instance and don't blink? And yellow line, if it already has one, why does it keep multiplying infinitely?
These lines are in your control.
And the lines that flicker react to any OnChartEvent, because
0 means false. Anything not 0 istrue. But has anyone thought about readability of such code, where all kinds of conditions are mixed?
It is not a boolean value. But it can be easily turned into a boolean:
So the main thing is to have the right approach to code writing. Then you willnever have such problems.
And if the object is "0" in the main window, it will return false?
And the lines that flicker react to any OnChartEvent, because.
I told him: Button pressed - create line, button released - delete (same with other types of objects that can be linked to). But he said: it's nothing, I'll do everything "normally". :)
And if the object is "0" in the main window, it will return false?
That's what can defeat your reluctance to read the documentation!
https://www.mql5.com/ru/docs/objects/objectfind
https://docs.mql4.com/ru/objects/objectfind
Return value
If successful, the function returns the number of the subwindow (0 means main chart window) where the found object is located. If no object is found, the function returns a negative number. To get more information aboutthe error, callGetLastError() function.
These lines are in your control.
And the lines that flicker react to any OnChartEvent, because
And if the object is "0" in the main window, will it return false?
I told him: Button pressed - create line, button released - delete (same with other types of objects that can be attached to). But he said: it's nothing, I'll do it properly. :)
Do you mean the colour change via property? I have such an option, I need to understand why it doesn't work.
Here's something that might defeat your unwillingness to read the documentation?!
https://www.mql5.com/ru/docs/objects/objectfind
https://docs.mql4.com/ru/objects/objectfind