Download MetaTrader 5

backtesting with pending StopLoss Orders

To add comments, please log in or register
Have you developed an application? Publish it in Code Base!
marsupilami
45
marsupilami 2016.06.11 11:18 

Hello,

I am bactesting a range breakout expert advisor using pending SL orders on an equity index CFD that trades only from 08:00 to 22:00 european time

 

Whenever a breakout occurs overnight Order gets executed by tester at 08:00 the following morning but at trigger level instead of market open which is absurd because it's physically impossible to trade at trigger level as market closed overnight and has opened with a gap.

 

Example:

Market Close 01.06.2016 22:00 is 10180.8

Pending SellStop Order valid overnight @ 10104.20

 Market Open 01.07.2016 08:00 is 9969.30

Tester executes Sell Order @ 10104.20 at 08:00

Illustration 

 

Any idea why this is happening ? Bug in mt4 backtest ? Misunderstanding from my side ?

 

Thank You, 

Doerk Hilger
1155
Doerk Hilger 2016.06.11 13:53  

Magic bug :)

Use MIT orders instead (market if touched) 

marsupilami
45
marsupilami 2016.06.11 14:27  
Doerk Hilger:

Magic bug :)

Use MIT orders instead (market if touched) 

Tks. By magic bug you mean it's a well known one in tester ?

 

Is there a function in mql4 for MIT orders ? or I guess I have to put a market order after a touch condition 

 

Are MIT orders better/faster than pending StopLoss Orders in term of live execution  ?

Alain Verleyen
Moderator
30739
Alain Verleyen 2016.06.11 15:50  
marsupilami:

Tks. By magic bug you mean it's a well known one in tester ?

 

Is there a function in mql4 for MIT orders ? or I guess I have to put a market order after a touch condition 

 

Are MIT orders better/faster than pending StopLoss Orders in term of live execution  ?

You are mixing pending (buy/sell) stop orders and and stoploss orders, they are not the same in MT4. Pending stoploss orders doesn't exist in MT4.

MIT order is just a nice name to place a market order (aren't all market orders place when some conditions are met ?)

Your issue is a "limitation" of MT4  strategy tester, don't place your order overnight, wait the opening.

To add comments, please log in or register