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

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
No Makar, it looks like this:
The ObjectFind() function returns the number of the main window. And this number is 0. On the other hand, 0 == false, so it follows that if the function returns 0, it still returns false. Of course, I would not use this because if the function returns -1, i.e. an error, we may consider the location of the object not in the main window. On top of that, you never know what fixes will be made...
So don't argue and don't study how to do it...
The ObjectFind() function does not return the number of the main window. It will return the number of window where the object was found (0, 1, 2...) or -1 if the object doesn't exist.
I wonder if "-1" is false or true.
The booltype is used to store the boolean values true or false, with a numeric representation of 1 or 0 respectively .The ObjectFind() function does not return the main window number. It is the number of window where the object is found (0,1,2...) or -1 if there is no object.
I was talking about specific case where object is located in main window. Don't argue and don't learn how to do it...
MakarFX #:
I wonder if "-1" is false or true?
The booltype is intended to store the boolean values true or false, whose numeric representation is 1 or 0, respectively .false is only 0. Everything else is true
false is only 0. Everything else is true
No Makar, it looks like this:
The ObjectFind() function returns the number of the main window. And this number is 0. On the other hand, 0 == false, so it follows that if the function returns 0, it still returns false. Of course, I would not use this because if the function returns -1, i.e. an error, we may consider the location of the object not in the main window. On top of that, you never know what fixes will be made...
So don't argue and don't learn how to do it...
I realize that you should not do so, but I had to for the sake of aesthetics (== 0 in every condition looks ugly). And I only need the object in the main window.
I know I shouldn't do this, but I had to for the sake of aesthetics (== 0 in every condition looks ugly). And I only need the object in the main window.
Then do the following
if there is no object, you'll get "-1", i.e. true
Problem: Yellow and grey lines ("Stop Sell" and "not allowed") are constantly created and flickering when the button is pressed on the chart. And ObjectCreate() constantly returns true instead of false, i.e. it creates as if in another window and that could explain the flickering... But the window is only the main one and there are no anomalies with the green line ("Buy Stop") as well as with the red one ("Stop Loss").
Then do the following
if there is no object, you get "-1", i.e. true
I've tried it, I just need to change object names (invert) for the exception to work. But this way no lines are created at all.
I've tried it, only you have to change the name of the objects. But this doesn't create any lines at all.
I have it created and so do you, only the price is "0".