Questions from Beginners MQL4 MT4 MetaTrader 4 - page 32

 
spoiltboy:

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 nobody noticed a simple error. You have ticketD and ticketUP declared on the local level and they are cleared when you exit theOnTick() function. Declare them at global level and you're in luck.
 
Sergey Gritsay:
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.
I've already written about it, but the message is ignored, the author stubbornly does not want to understand anything, just hit an obstacle, and instead of getting around it, trying to break the reservation.
 

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 !?

OBJ_TEXT - Типы объектов - Константы объектов - Стандартные константы, перечисления и структуры - Справочник MQL4
OBJ_TEXT - Типы объектов - Константы объектов - Стандартные константы, перечисления и структуры - Справочник MQL4
  • docs.mql4.com
OBJ_TEXT - Типы объектов - Константы объектов - Стандартные константы, перечисления и структуры - Справочник MQL4
 
Игорь: Здравствуйте ! помогите советом !

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.

input ENUM_ANCHOR_POINT InpAnchor=ANCHOR_LEFT_UPPER; // Способ привязки
 
Sergey Gritsay:

There's a typo in the code, it looks like this

input ENUM_ANCHOR_POINT InpAnchor=ANCHOR_LEFT_UPPER; // Способ привязки


Sergey Gritsay:

A typo in the code looks like this

input ENUM_ANCHOR_POINT InpAnchor=ANCHOR_LEFT_UPPER; // Способ привязки


Thank you so much !!!!
 
Sergey Gritsay:
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.

Vitaly Muzichenko:
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.

 
spoiltboy:
.....
So, is it working?
 
Renat Akhtyamov:
So, is it working?

Yes.

I'll keep looking into it.

Reason: