Acceptance of SL/TP orders - page 3

 
fxsaber:

Unfortunately, it's not possible to monitor the acceptance of pending orders, because this information is not available on the Terminal side. But almost invariably, the presence of significant lags on the TP/SL orders side cannot but affect the lags when executing the orders. Since the cause seems to be of the same nature.

Limiter trigger log taken from the trade server.

2020.11.26 09:32:23.053    '': order [#199 sell limit 0.01 EURSEK at 10.15957] triggered, activation price 10.16102 [10.16102 / 10.16354]


Accept-Tick.


3ms lag on limiter execution. Probably very expensive margin correctness checks, etc.

Perhaps there is an option on the server to disable checks.


So far the intermediate conclusion is that the lag is of the same nature, both for TP/SL levels and for the orders.


HH The tick was written to the MT5 database at 09:32:23.050, but it was 09:32:23.039 on the trading server machine before that. That is, 11 ms earlier. Total 14 (11 + 3) ms lag.

 
People live.) 3 milliseconds is a problem.
 
Dmitry Fedoseev:
People live)) Three milliseconds is a problem.

This is on a completely empty trade server with zero CPU load.

The example above was for hundreds of milliseconds on MQ-Demo.

As it is, even three milliseconds is often the cause of a redirect. It's like not being able to catch a plane because of a traffic light.

 
fxsaber:

SZY The tick was recorded in MT5 database at 09:32:23.050, but the machine with the trading server before that hit at 09:32:23.039. That is, 11 ms earlier. Total 14 (11 + 3) ms lag.

Please also check the speed of writing ticks to the MT5 base.

 

I only had one order on my real account that closed on a takeaway, not surprisingly, the stock)))

QD      0       21:14:14.049    CheckOrders (GAZP,D1)   ServerName: Open-Broker
MN      0       21:14:14.049    CheckOrders (GAZP,D1)   
LF      0       21:14:14.078    CheckOrders (GAZP,D1)   Last Tick 2020.11.13 21:45:51.656 180.84 180.89
CK      0       21:14:14.078    CheckOrders (GAZP,D1)   Accepted Tick 2020.11.13 21:45:51.656 180.84 180.89
PS      0       21:14:14.078    CheckOrders (GAZP,D1)   Accepted Length = 14 ms.
EK      0       21:14:14.078    CheckOrders (GAZP,D1)   Order 139999826 ORDER_TYPE_SELL GAZP 2020.11.13 21:45:51.670 180.84 ORDER_REASON_TP ORDER_STATE_FILLED 2020.11.13 21:45:51.670, Position 139820013 created 2020.11.12 20:41:42.184, StopLevel = 0
 
Aleksandr Slavskii:

I only had one order on my real account that closed on the take, not surprisingly, stock)))

You have a very cool situation.

on my real account that has closed at take value, it is not a surprise, it's a stock)))

Order 139999826 ORDER_TYPE_SELL GAZP 2020.11.13 21:45:51.670 180.84 ORDER_REASON_TP ORDER_STATE_FILLED 2020.11.13 21:45:51.670, Position 139820013 created 2020.11.12 20:41:42.184, StopLevel = 0

The timing of TP order and its execution coincides with the accuracy of a millisecond. Perhaps, this is a peculiarity of the exchange.

But the take order birth time is 14 milliseconds. For a stock market trade, that's a lot.

 

Seems to have figured out the cause. Running the script on the machine the server is running on.

// Преобразование времени в миллисекундах в строку.
string TimeToString( const long time, const int FlagTime = TIME_DATE | TIME_SECONDS)
{
  return(TimeToString((datetime)time / 1000, FlagTime) + "." + IntegerToString(time % 1000, 3, '0'));
}

// Преобразование тика в строку.
string TickToString( const MqlTick &Tick, const int digits )
{
  return(TimeToString(Tick.time_msc) + " " + DoubleToString(Tick.bid, digits) + " " + DoubleToString(Tick.ask, digits));
}

void OnTick()
{
  MqlTick Tick;
  
  if (SymbolInfoTick(_Symbol, Tick))
    Print(TickToString(Tick, _Digits));
}


Result.

2020.11.27 22:13:44.156 2020.11.27 22:13:44.149 1.59953 1.59993
2020.11.27 22:13:44.862 2020.11.27 22:13:44.855 0.98789 0.98837
2020.11.27 22:13:45.263 2020.11.27 22:13:45.258 0.98789 0.98839
2020.11.27 22:13:46.878 2020.11.27 22:13:46.873 10.15554 10.16084
2020.11.27 22:13:48.993 2020.11.27 22:13:48.991 10.15554 10.16106
2020.11.27 22:13:51.722 2020.11.27 22:13:51.716 0.98789 0.98840
2020.11.27 22:13:53.035 2020.11.27 22:13:53.027 1.59950 1.59995
2020.11.27 22:13:53.134 2020.11.27 22:13:53.128 1.59954 1.59995
2020.11.27 22:13:53.737 2020.11.27 22:13:53.734 0.98789 0.98839
2020.11.27 22:13:54.745 2020.11.27 22:13:54.743 0.98789 0.98840
2020.11.27 22:13:56.768 2020.11.27 22:13:56.761 0.98789 0.98839
2020.11.27 22:13:57.977 2020.11.27 22:13:57.973 1.59954 1.59994
2020.11.27 22:14:00.293 2020.11.27 22:14:00.292 10.15554 10.16093
2020.11.27 22:14:04.131 2020.11.27 22:14:04.125 1.59954 1.59995
2020.11.27 22:14:08.868 2020.11.27 22:14:08.866 0.98789 0.98841
2020.11.27 22:14:09.780 2020.11.27 22:14:09.773 0.98789 0.98840
2020.11.27 22:14:09.981 2020.11.27 22:14:09.975 1.59955 1.59994
2020.11.27 22:14:10.085 2020.11.27 22:14:10.076 1.59957 1.59994
2020.11.27 22:14:10.180 2020.11.27 22:14:10.177 1.59957 1.59995

On the left is the print time. On the right is the time of the incoming tick. The lag can be clearly seen. It appears that OnTick is triggered a few milliseconds later than the tick is written to the trade server.


It seems that the part of the server responsible for order activation is delayed, as it happens with their arrival to the terminal.

 
fxsaber :

I've got a whole log of messages like that, too. Perhaps things will change after the weekend.


2020.11.25 16:52:52.992 Trades  '92810': failed modify #1758569 sell 0.02 USDJPY sl: 0.000, tp: 104.293 -> sl: 0.000, tp: 0.000 [Unknown error]

gone.


2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Total Orders (from 2020.11.30 00:00:00) = 899, calculated = 58
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Calculation time = 00:00:00.000
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  ServerName: RannForex-Server
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:45.786 104.369 104.369
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.712 104.365 104.365
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 1077 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774962 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:45.789 104.365 ORDER_REASON_TP ORDER_STATE_FILLED 2020.11.30 19:07:45.802, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Orders (6) before 1774962 with PositionID = 1774955:
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  ------------------------
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:44.766 104.366 104.366
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.766 104.366 104.366
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 2 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774959 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:44.768 104.365 ORDER_REASON_TP ORDER_STATE_REJECTED 2020.11.30 19:07:44.780, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:44.874 104.367 104.367
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.712 104.365 104.365
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 164 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774960 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:44.876 104.365 ORDER_REASON_TP ORDER_STATE_REJECTED 2020.11.30 19:07:44.900, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:44.940 104.368 104.368
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.712 104.365 104.365
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 230 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774961 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:44.942 104.365 ORDER_REASON_TP ORDER_STATE_REJECTED 2020.11.30 19:07:44.954, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Checked Orders = 3
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  ------------------------
 
Enrique Dangeroux:

gone.

Your log fully confirms that the repeat TP order is only formed after the arrival of a new tick.

Forum on trading, automated trading systems and trading strategy testing

Acceptance of SL/TP orders

Enrique Dangeroux, 2020.11.30 19:04

2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:45.786 104.369 104.369
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.712 104.365 104.365
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 1077 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774962 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:45.789 104.365 ORDER_REASON_TP ORDER_STATE_FILLED 2020.11.30 19:07:45.802, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Orders (6) before 1774962 with PositionID = 1774955:
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  ------------------------
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:44.766 104.366 104.366
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.766 104.366 104.366
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 2 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774959 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:44.768 104.365 ORDER_REASON_TP ORDER_STATE_REJECTED 2020.11.30 19:07:44.780, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:44.874 104.367 104.367
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.712 104.365 104.365
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 164 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774960 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:44.876 104.365 ORDER_REASON_TP ORDER_STATE_REJECTED 2020.11.30 19:07:44.900, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Last Tick 2020.11.30 19:07:44.940 104.368 104.368
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Tick 2020.11.30 19:07:44.712 104.365 104.365
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Accepted Length = 230 ms.
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Order 1774961 ORDER_TYPE_SELL USDJPY 2020.11.30 19:07:44.942 104.365 ORDER_REASON_TP ORDER_STATE_REJECTED 2020.11.30 19:07:44.954, Position 1774955 created 2020.11.30 19:07:22.655, StopLevel = 0
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  Checked Orders = 3
2020.11.30 18:52:09.327 OrderCheck (GBPAUD,H1)  ------------------------

Have been dealing with the broker on a lot of other similar logs (today) dealing with these situations.

 

https://www.mql5.com/ru/forum/341117 is still a current problem


As for the magazine, there were no "trade settings".