Drag and drop SL and TP in the tester. - page 10

 
You can move the stop by holding down the left mouse button on the SL+ or SL- button. Poll the status of the left mouse button while the left mouse button is held down to increase or decrease the stop. Released the button - stop is stopped. This seems to me a good way to do it. Corresponding button must be preselected (clicked by left mouse button), and then you have to repeatedly click the left mouse button over this button for stop movement.
 
Artyom Trishkin:
Will the timer not work for polling everything?
Doesn't work in the MT4 tester (
 
khorosh:
You can move stop by holding left mouse button pressed on SL+ or SL- button. Check mouse left button status and increase or decrease stop while it is held down. Release button - stop. This seems to me a good way to do it. Corresponding button must be preselected (clicked by left mouse button), and then you have to repeatedly click the left mouse button over this button for stop movement.

If events are handled as you write, then you clicked with the mouse - where you clicked, they took SL

where you let go - there you put SL

 
Alexey Volchanskiy:
In the MT4 tester it doesn't work (

The question was about non tester:

Forum on trading, automated trading systems and strategy testing

Drag and drop SL and TP in the tester.

Dmitry Fedoseev, 2016.02.15 18:43

I wish I could think of something so that when working on an account the EA would have an instant reaction to the global variables created by the indicator, instead of waiting for a tick.

 
No one has tried the sequence in which EA and indicator events are triggered?
 
Dmitry Fedoseev:
No one has tried the sequence in which expert and indicator events are triggered?

Generally, click events in MQ are incomplete, they are handled only after releasing the mouse button, and they should be handled when the button is pressed, as it is done in js

mousedown - Mouse button is pressed.

mouseup - Mouse button released.

About the sequence, it looks like the indicator works first and then the expert.

 
Vitaly Muzichenko:

Generally, click events in MQ are incomplete, they are handled only after releasing the mouse button, and they should be handled when the button is pressed, as it is done in js

mousedown - Mouse button is pressed.

mouseup - Mouse button released.

About the sequence, it seems that the indicator works first and then the Expert Advisor.

The current state of the left mouse button can now be tracked by theCHARTEVENT_MOUSE_MOVE event (parameter sparam).
 
Yes I have checked, the ChartEvent indicator always has the first one.
 
Made the SL and TP move with buttons as conceived in the previous post. It works fine. I think it's better and more convenient than moving SL and TP by dragging additional objects like lines, arrows, etc. The step of movement can be changed using the buttons as well.
 
pako:

If events are handled as you write, then you clicked with the mouse - where you clicked, they took SL

where you let go - there you put SL

It is possible to try. Although I am quite happy with the version I just did.