Limit order slippage statistics on the exchange - page 8

 

TP gets negative slippage in the tester

PQ      0       23:57:02.304    Trade   2018.03.29 23:59:14   position modified [#154  sell 1.00 TESTER 0.87670 tp: 0.87689]
JH      0       23:57:02.304    Trade   2018.03.30 00:03:35   take profit triggered #154  sell 1.00 TESTER 0.87670 tp: 0.87689 [#157  buy 1.00 TESTER at 0.87689]
QQ      0       23:57:02.304    Trades  2018.03.30 00:03:35   deal #153  buy 1.00 TESTER at 0.87729 done (based on order #157)
 CG      0       23:57:02.304    Trade   2018.03.30 00:03:35   deal performed [#153  buy 1.00 TESTER at 0.87729]
DK      0       23:57:02.304    Trade   2018.03.30 00:03:35   order performed buy 1.00 at 0.87729 [#157  buy 1.00 TESTER at 0.87689]


In this case the BUY position should have closed at TP = 0.87689 but the TP level closed at 0.87729, getting a negative slippage of -40 pips!

Why can TP slide negatively in the Tester?

We have managed to get limit orders not to slide in the Tester. But the situation with TP is not good - they are market and therefore slide. How would you disable sliding and TP in the Tester?

 
fxsaber:

In the TP tester, TP gets negative slippage

Here's the reason. Log

CM      0       00:30:17.505    Trade   2018.03.28 23:48:46   position modified [#165  buy 1.00 Si-6.18 58290 tp: 58300]
DJ      0       00:30:17.507    Trade   2018.03.29 10:00:00   take profit triggered #165  buy 1.00 Si-6.18 58290 tp: 58300 [#168  sell 1.00 Si-6.18 at 58300]
RQ      0       00:30:17.507    Trades  2018.03.29 10:00:00   deal #163  sell 1.00 Si-6.18 at 58255 done (based on order #168)
 FI      0       00:30:17.507    Trade   2018.03.29 10:00:00   deal performed [#163  sell 1.00 Si-6.18 at 58255]
NI      0       00:30:17.507    Trade   2018.03.29 10:00:00   order performed sell 1.00 at 58255 [#168  sell 1.00 Si-6.18 at 58300]

I.e. we have TP 58300 and execution at 58255. At the same time, the time of TP execution (DEAL_TIME) is 10:00:00.001, but the price of TP execution corresponds to the future one - 10:00:00.024. That is, TP is not only executed with a negative slippage, but it is also filled using future prices.

Something has gone wrong in the tester with fins and maybe not only with them. We'll have to check the Tester's adequacy. Again, you can't trust him.

Please add a fix for this bug in the next build. Make the execution for TP in the Tester the same as for limit orders!

 
fxsaber:

Make execution for TP in the Tester like for limit orders!

Why? TP is not a limit order but an orderexecuted in the market at specified conditions. Consequently, the slippage will often be negative if it is at the correct TP point (where large volumes of limit order are being purchased) and positive (say, when breaking through the level when a stop triggered by people) if it is not at the correct TP point. I would like to be able to set slippage independently in the tester - then whoever needs it will do so.

 
Aleksey Vyazmikin:

Why? On an exchange, TP is not a limit butthe execution of amarket order under specified conditions.

Because the Tester is not an exchange. TP on an exchange can have negative slippage due to the lag factor, which is not present in the Tester in "No Delay" trading mode.

 
Aleksey Vyazmikin:

Why? On an exchange, TP is not a limit, butthe execution of amarket order under specified conditions.

Really?
 
Комбинатор:
Really?

Unfortunately, it is.

 
fxsaber:

Unfortunately, it is.

in MT5 and on the exchange are two big differences
 
Комбинатор:
In MT5 and on the stock exchange there are two big differences

I doubt there is even such a thing as a TP order on an exchange.

 
fxsaber:

I doubt there is even such a thing as a TP order on an exchange.

Why bother with this question? it turns out mt5 is not mt5 and TP is not made humanly
 
Комбинатор:
Then why even ask that question?

To the MT5 Tester, not the exchange. At least let the TP in the tester work in a human way. What prevents MQ from sending limiters instead of market - is not clear.

As far as TP is concerned, this is a flower

Forum on trading, automated trading systems and strategy testing

Bugs, bugs, questions

fxsaber, 2018.03.05 19:22

Tester bug.

Let there is a BUY position with TP first. And there is a SellLimit on the same TP. Tester executes such situations in different ways

  • first BUY_TP, then SellLimit.
  • first SellLimit, then Sell_TP.

In the second case we have two opposite positions opened at once in a hedge or a BUY position closed without opening SELL.

For hedges it is aggravated by the fact that SellLimit may be redeemed due to insufficient money to open the second position.

In general, please lead the Tester to unambiguous behaviour - first TP, then Limit.


This is a real problem with Limit.

Forum on trading, automated trading systems and strategy testing

Bugs, bugs, questions

fxsaber, 2018.02.14 14:41

The bug is not in the terminal, but in the MT5 platform
#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
#define Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnStart()
{
  OrderSend(_Symbol, OP_BUY, 1, Ask, 100, 0, Bid);
  
//  OrderSend(_Symbol, OP_BUYLIMIT, 1, Ask, 100, 0, 0);
}

Run on MQ-Demo on some slow moving symbol. EURHUF for example.

The script opens a BUY position with TP = Bid. I.e., the position should close immediately. But TP will be checked for compliance with the acceptance condition only on the next tick!

The position will not be closed immediately until the next tick occurs. Moreover, if the next tick has Bid < TP, the TP will remain without any acceptance.


The same applies to limit orders (commented line). The situation is the same in the tester.


And the cherry.

Forum on trading, automated trading systems and strategy testing

Typical errors and how to fix them when working with a trading environment

fxsaber, 2018.02.24 16:25

I'll even show you what such cancelled market orders look like

Only there is no error.

This example turned out to be much cooler. A TP placed by the broker itself got coded! And almost immediately (I was waiting for 115 ms-apparently it was a bug of MT5) after the re-order was closed, the broker set another TP, which was executed. The comments to the orders did not show up in the screenshot. Green colour isORDER_REASON_TP. Accordingly, the order even has the ORDER_POSITION_ID.

I.e., TP is reordered and waits for the next tick to be reordered. It is not set immediately.