Movable buttons in MT4
-
I have made a trade management tool that consists out of 6 separate buttons in MT4 (See attachment Buttons). Now they are being displayed on a fixed area in MT4. I would like to be able to move the Trade management tool around without selecting the 6 separate buttons. Is there a way to make something like an object container that contains all 6 buttons, so I can drag this container around in MT4?
Thank you in advance.
......
Buttons.png -
I don't know, to be honest. All "Draw... " blocks are pretty simple and they do exactly that - creating/updating objects on the chart. I don't really know how more complicated things happen
-
you can try make one object like reference object (your rectangle) and others block x y calculated from this rectangle - after rectangle is moved - store into variables its position, and x y for buttons is calculated from this position ...
-
__you can try make one object like reference object (your rectangle) and others block x y calculated from this rectangle - after rectangle is moved - store into variables its position, and x y for buttons is calculated from this position ...[/quote:1dplpdqs]
Thank you for your help. I understand your suggesting but I have no idea how to store position xy into variables as I am quite new at this. Do you maybe have an example to help get me going?
-
try this:
https://fxdreema.com/shared/uUwliI43c

-
__try this:
https://fxdreema.com/shared/uUwliI43c
;)[/quote:3d7t3h71]Thank you very much, after some experimenting I managed to get into the right direction.
-I created a rectangle from which xy are stored in variables;
-Button 1 looks at these stored xy variables and uses them to reposition when rectangle is moved;The problem I am facing now is as following:
- Button 1 gets it's coordinates from the xy variables, the other buttons should look at the same x-variable (which is no problem), but the y variable is different for each button.
- So Buttons 2-6 should look at variable_y - value
Is there a block that I can use for this, and if so which one?
Thanks!
-
____try this:
https://fxdreema.com/shared/uUwliI43c
;)[/quote:2iph71rm]Thank you very much, after some experimenting I managed to get into the right direction.
-I created a rectangle from which xy are stored in variables;
-Button 1 looks at these stored xy variables and uses them to reposition when rectangle is moved;The problem I am facing now is as following:
- Button 1 gets it's coordinates from the xy variables, the other buttons should look at the same x-variable (which is no problem), but the y variable is different for each button.
- So Buttons 2-6 should look at variable_y - value
Is there a block that I can use for this, and if so which one?
Thanks![/quote:2iph71rm]
here for you, hope you learn something new - be aware on blocks order, numbers, etc. ... dont forget to check OnInit section and OnChart section, both are used

https://fxdreema.com/shared/SbS1f5g0c -
Thank you, it is working now. Learned a lot
