backtesting with pending StopLoss Orders

 

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, 

 

Magic bug :)

Use MIT orders instead (market if touched) 

 
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  ?

 
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.