Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1284
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
Thanks again, now the line is like a line, nice to see. OnlyObjectDelete(0, name);; is needed, otherwise once drawn the line is not redrawn. The same in mql4, I just forgot.
I would have done so
What a nonsense. The drawn graphical object moves smoothly. Example is given in help for each object (for horizontal lineOBJ_HLINE).
You can also change any property to an already drawn object: colour, style , smell ...It is done manually, I don't argue. But the Expert Advisor draws trend lines by DeMark points. With the function ObjectDelete(0, name);, when the points change, the old trend line is removed and a new one is drawn. Without this function, the first drawn lines are no longer redrawn. This is not nonsense, it's a fact.
Manually, I don't argue. The Expert Advisor, on the other hand, draws trend lines by DeMark points. With function ObjectDelete(0, name);, when the points change, the old trend line is removed and a new one is drawn. Without this function, the first drawn lines are no longer redrawn. This is not nonsense, it is a fact.
Why don't you read the help? And run the example.
I'd do that.
Thanks, but I'll leave my variant, it works. Although I'll try it instead of ObjectDelete(0, name);.
ChartRedraw();
Read the help, for God's sake! And run the example.
I've read the reference. Only you are indignant and I'm writing from practice. Another thing is to use ChartRedraw() instead of ObjectDelet(), I don't argue and will check it. This is the only thing you need to point out by referring to the example.
I have read the brief. Only you are indignant with words and I am writing from practice. Another thing is to use ChartRedraw() instead of ObjectDelet(), I don't argue and check it. This is the only thing you need to point out by referring to the example.
People usually ask for advice in this thread and when they get it, they listen. At the very least read the help and apply examples. Please, if you don't want to listen to others, don't ask anything at all.
An example of how you can change any property of the"Horizontal line" graphical object on the fly - you don't need to delete the object to do this, you just need to change the property.
Code:
Thanks, but I'll leave my variant, it works. Although I will try it instead of ObjectDelete(0, name);.
Completely wrong decision. Deleting a graphical object and refreshing a chart in no way replace each other.
My example first checks if there is an object, in particular, a trend with the name tfyu, which is name in the Russian keyboard layout)). Then, if it does not exist, the trend is drawn. If the drawing attempt is unsuccessful, the message is displayed and the function is exited with return false.
Everything after that, irrespective of whether the trend is already present or has just been drawn, it is assigned the specified parameters, time and coordinate prices, type, thickness and anything else you can add. After that the chart is updated and the function returns true.
In terms of speed of execution, it will be less expensive to check for the presence of the trend than to delete it and draw a new one.
But... the final decision is up to you and if you like scratching your left ear with your right little finger, I have no right to stop you.
And back to drawing the trend line. If you need code.
Very bad code.
I would do this.
I would have done this: