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

 
Dmitry Fedoseev:
I'd also like to think of something so that when working on the account, the EA has an immediate reaction to the global variables created by the indicator, rather than waiting for a tick.
Wouldn't a timer work for polling everything?
 
khorosh:
For some reason, the EA is only supposed to start with a tick. It would be nice if it could also run on an event. There is an option of only a looped script instead of an EA, but again, it is a heavy load on the computer. Can a single execution of the script be encoded in some way by an event? The script can be launched using hotkeys. How about simulating the pressing of these hot keys using events? The script code should be made absolutely identical to that of the Expert Advisor. Then it will do the same thing as the Expert Advisor in the gap between ticks.
Just found something similar now.https://www.mql5.com/ru/forum/3990
Ускорение работы эксперта путем запуска дополнительного скрипта
Ускорение работы эксперта путем запуска дополнительного скрипта
  • www.mql5.com
В MQL5 ввели механизм, при котором эксперт не ждет результат выполнения торговой операции. - - Категория: общее обсуждение
 

First we need to check where the chart event occurs first in the indicator or in the EA, if in the indicator (most likely it does), then when working in the tester we catch the globals in onTick(), and when working in the account in onChartEvent().

The timer is not interesting, it implies not instant reaction.

 

When setting each order, you create two stop and profit objects, then every tick you read them and check if they have changed compared to the real ones, if they have, you modify the order... and then drag them on the chart as you want

SL=NormalizeDouble(ObjectGetDouble(0,sltx,OBJPROP_PRICE,0),digit);
TP=NormalizeDouble(ObjectGetDouble(0,tptx,OBJPROP_PRICE,0),digit);
 
noloxe:

When setting each order, you create two stop and profit objects, then every tick you read them and check if they have changed compared to the real ones, if they have, you modify the order... and then drag them on the chart as you want

This option has already been suggested before. I would like to somehow arrange it with events without additional lines.
 

...create arrows/dashes instead of lines)

events in the tester do not work

ps. if there is only one open order in the EA at the same time, then the stop and profit objects should be reset to the new order

 
Dmitry Fedoseev:

First we need to check where the chart event occurs first in the indicator or in the EA, if in the indicator (most likely it does), then when working in the tester we catch the globals in onTick(), and when working in the account in onChartEvent().

The timer is not interesting, it implies not instant reaction.

Well, I wouldn't bother. Polled buttons in a millisecond timer, and then - a matter of technique.
 
noloxe:

...create arrows/dashes rather than lines)

events in the tester do not work

ps. If there is only one open order in the EA at the same time, then the stop and profit objects are the same as for the new order

Events do work in the indicator installed on the visual chart of the tester. I have this idea: each press of the +SL or -SL button moves SL by one point or by 5 points, as it needs. This, of course, is not a drag, but not bad either. Maybe even better. I probably will stop at this one. (Simple and tasteful.) It's easy to implement with one order. But, if we have more than one, we will need to implement another order triggering device. But, I usually test strategies with one order.

 
khorosh:

In the indicator installed on the visual test chart the events are working. I came up with the following idea: each press of +SL or -SL button moves SL by one point, or by 5 points to whichever is necessary. This, of course, is not a drag, but not bad either. Maybe even better. I probably will stop at this one. (Simple and tasteful.) It's easy to implement with one order. But, if we have more than one, we will need to implement another order triggering device. But, I usually test strategies with one order.

Have you tried the file I have attached on the first page? Try to drag the line - it is very convenient and fast, try to implement it in your own way.
 
Vitaly Muzichenko:
Have you tried the file I attached on the first page? Try dragging the line - it's very convenient and fast, try it yourself as well
Well, I've known the principle for a long time. I just want to think of something new. Your Expert Advisor is half-finished. When drawing lines, modification of stop and take does not occur and in general, the initial stop and take is not set or I need to click something for that. I do not understand it.