![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
It's without a condition - because that's how deletion works, but with a condition it doesn't. I wrote it this way to point out what I can't do. If you write it in this way:
OrderDelete(ticketD);
OrderDelete(ticketUP);
Then every tick deletes orders already created on every tick (according to the absence condition). And if we write it with the condition:
if (x!=maxpr1){x=maxpr1; OrderDelete(ticketD);}
if (z!=minpr1){z=minpr1; OrderDelete(ticketUP);}
Then when the condition occurs, it writes a deletion error.
How do I write the deletion of the specified orders in this condition?
So much discussion and no one has noticed a simple error. You have ticketD and ticketUP declared at local level and they will be reset when you exitOnTick() function. Declare them at global level and you're in luck.
You shouldn't do that.
I sense a shout of "BINGO!" coming up.
https://docs.mql4.com/ru/constants/objectconstants/enum_object/obj_text
I copied the code from the link and pasted it into the unit and it complains about the following line when compiling
input ENUM_ANCHOR_POINT InpAnchor=ANCHOR_BOTTOM; // Binding method
but specifically to ANCHOR_BOTTOM !?
what should be done to make it look like on the picture !?
https://docs.mql4.com/ru/constants/objectconstants/enum_object/obj_text
I copied the code from the link and pasted it into the unit and it complains about the following line when compiling
input ENUM_ANCHOR_POINT InpAnchor=ANCHOR_BOTTOM; // Binding method
but specifically to ANCHOR_BOTTOM !?
what should be done to make it look like on the picture !?
https://docs.mql4.com/ru/constants/objectconstants/enum_object/obj_text
I copied the code from the link and pasted it into the unit and it complains about the following line when compiling
input ENUM_ANCHOR_POINT InpAnchor=ANCHOR_BOTTOM; // Binding method
but specifically to ANCHOR_BOTTOM !?
what should I do to make it look like on the picture !?
There must be a misprint in the code.
There's a typo in the code, it looks like this
A typo in the code looks like this
So much discussion and nobody noticed a simple mistake. You have ticketD and ticketUP declared at local level and they are zeroed whenOnTick() function exits. Declare them at global level and you're in luck.
Thank you.
I already wrote about it, but the message is ignored, the author stubbornly does not want to understand anything, just stumbles into an obstacle, and instead of bypassing it, tries to break the reservation.
Don't consider me ignorant, I've just started to learn, I've only watched 2 tutorials on youtube and I'm trying to figure it out. There's a lot you don't understand at this stage. Apparently, at this stage, sometimes you need a straightforward explanation. And there's no mistake about it.
.....
So, is it working?
Yes.
I'll keep looking into it.