EJECUTAR CODIGO AL DESELECCIONAR OBJET0
-
Hi.
I would like to draw a fibo manually, and when I deselect it, let it run code below it.
I have not seen any box that detects a selected object.
Is it possible to do this? -
@cesardefez What do toy exactly mean by 'let it run code below it'?
-
I want to draw a fibo by hand, while the fibo is selected, I don't want it to place pending orders at fibo levels, I want it to place them, when I deselect the fibo is when the EA places the orders.
-
@cesardefez I don't understand the logic behind that. What's the point of opening trades when the fibo is deselected only? I find it too complicated for no apparent reason.
-
@l-andorrà lo que no pretendo es que me abra operaciones mientras que estoy posicionando el fibo, de esta forma me deja desplazar, redimensionar a mi gusto. cuando ya decido que esta bien, des-seleciono el fibo y es cuando quiero que coloque barias ordenes pendientes en un nivelfibo-
-
@cesardefez Entonces, si lo entindo bien, tu tienes operacions abiertas en este momento y seleccionas el fibo para realizar algunos cálculos. Mientras lo tienes seleccionado, NO quieres que se abran nuevas operaciones. Luego lo deseleccionas y a partir de ese momento, ya puede lanzar operaciones de nuevo. ¿Es correcto?
-
si, efectivamente
-
@cesardefez Entonces puedes probar esto en la pestaña 'On Chart':

En el recuadro señalado de arriba has de escribir el nombre del objeto. En tu casom del fibo. Sobre todo, no le cambies el nombre al fibo o no te lo reconocerá.
En el recuedro señalado de abajo has de escribir los números de los bloques de compra y venta. Eso los anulará mientras el objeto esté modificado.
-
muchas gracias lo pruebo,.
la pestaña on chart no suelo tenerla en cuenta. y por lo visto es muy interesante, ya es la segunda vez que me hacen referencia a esta pestaña.
es hora de estudiarla detenidamente.
muchas gracias MAESTRO. -
@cesardefez De nada, hombre.

-
Hi, I'm still trying to make the ea.
for the moment, I can draw a button, and when I press it draws me a fibo that is selected.
As soon as you draw the fibo, I want you to turn off the pin 20, the logic hangs from this pin to open the orders.
as soon as I deselect I want it to turn on the brooch 20, to let the orders execute.

As seen in the screenshot, the logic I want to use, and I don't know if it's okay, is the following:
if the fibo is selected? = false, then go to the next pin where you turn on pin 20, in order to place orders.
it doesn't work for me.I don't know if it is because of the logic I use in this screenshot, or because when I put that the price reaches the fibo price level, I have it wrong.
I have tried to put.
I have tried to level, (an integer n, 4) and also in% 61.8. but it doesn't work for me in any way.

-
@cesardefez Those screenshots are not enough informative. Can you please share the linkto the project?
-
Hola buenas, a ver si puedo echar una mano. Como dice @l-andorrà es díficil sin ver el proyecto. No se si lo tendrás hecho, pero prueba a asignarle una variable al nivel del precio del fibonacci,
saludos.
-
Hello @cesardefez , as they comment you have to identify the Fibo, but here unless you have a Fibo that is always renamed with the same name you have it very difficult since either MQL5 or MQL4 always identifies you, names the Fibo and with a name always different and random.
-
https://fxdreema.com/shared/EpjSRUS0d
here is the project link.
I have been modifying things as I try.
Is it possible to name the fibo when you create it? -
@cesardefez Naturally it is possible to rename it but I advise you, it is faster, create a Script to rename the Fibo always with the same name and so in the EA you will not have problems, I have done the same but with a Horizontal line.
-
when pressing the button, a fibo is drawn and it remains selected. when drawing the fibo I turn off block 140
Usually it always puts the same name, but just in case I verify it in fibo properties.
what I hope is that when I deselect fibo, I activate block 140 to put operations.
I don't know why it doesn't work for me.
can someone check it out,?
https://fxdreema.com/shared/EpjSRUS0d
Thank you