MT4 Strategy Tester and Gaps

 
Hi

I have a couple of questions on the behaviour of the strategy tester in the presence of gaps. I did a quick search and didn't spot the answers, however please let me know if these are documented somewhere.

I've made some numbers up for the purpose of the question, and I've missed the spread here to make things simpler.

So let's say
Bar 1 - open 10, close 20
Bar 2 - open 40, close 50
Bar 3 - open 50, close 51
Obviously there's a gap between Bar 1 and Bar 2.
Let's say I have the following Open and Pending Orders before the open of Bar 1. Assuming that I have chosen 1M 1 minute bars, and have no intra-bar ticks (ie my EA is only called once at the end of each bar),  
I'd like to know at what point the following orders are opened / closed (where applicable), and at what prices (ignoring spread).
A - Open Buy Order, Limit @25
B - Pending Buy Stop Order, Stop @25, Limit @35
C - Pending Buy Stop Order, Stop @25, Limit @45
Many thanks.

            
 
cms550790:

The gap you mentioned happens only during weekend or high risk event such as news. Gaps rarely happens under normal trading circumstances, but if you experience, better to check with your feedprovider...
 

cms550790:

Hi
I have a couple of questions on the behaviour of the strategy tester in the presence of gaps. I did a quick search and didn't spot the answers, however please let me know if these are documented somewhere. 
"Gaps" happen all the time,  you don't see them when they happen inside a bar . . .  so why are you only concerned when they happen between the close of one bar and the open of the next ?
 
cms550790: behaviour of the strategy tester in the presence of gaps
Tester does not model gaps. If it gaps above your TP, tester closes AT the TP. If it gaps below your SL, closes AT the SL.
 

Thank you all for the prompt replies, points understood.

Let me add some background here.

I have an EA, however I also have another piece of software, let's call it the 'auditor', that checks that the EA is doing the right thing, making the correct orders at the right time etc.

What the auditor flagged was the following 

B - Pending Buy Stop Order, Stop @25, Limit @35
B Pending
Bar 1 - open 10, close 20
B Pending
Bar 2 - open 40, close 50
B Opened
Bar 3 - open 50, close 51
B Closed

whereas in reality it was expecting (and what I'd expect in reality)

B - Pending Buy Stop Order, Stop @25, Limit @35
B Pending
Bar 1 - open 10, close 20
B Pending
Bar 2 - open 40, close 50
B Closed
Bar 3 - open 50, close 51
B Closed

After the gap, the strategy tester modelled the order as still open, whereas in reality I believe it should already have been closed. In fact, I had a number of buy stops that I expected to be closed, but were all open following the initial bar after the gap, and only closed on the subsequent bar. The upshot of this was that my EA didn't place subsequent trades until the initial buy stops were closed, so to my auditor it looked like the trades were being placed 'late'.

My intention is that the auditor be able to run with either the strategy tester or with live trading, and therefore needs to understand nuances such as these to be effective. My objective here was really to understand the way MT4 models orders during testing in the presence of such data so I can make adjustments to the auditor as necessary.

Thanks.

 
So to close this off, can I confirm that this is indeed the expected behaviour of the strategy tester. Fine if that's the case, I'd just like to confirm that I'm seeing expected behaviour rather than some other problems, potentially in my EA. Thanks.
 
The quality and defects MT4 tester has been written in the world sea of content. I will add one more drop.

As the tester closes positions for Sunday's gaps.

GapC



And so it happened to me that just shut broker real open positions. Of course, the intervention improved, but as you have dozens of items per day, the flowers can escape.
Is not that a problem MT4, which is also accurately reproduced in the MT4 broker's side?

 
mike05:

Of course, the intervention improved, but as you have dozens of items per day, the flowers can escape.

Only Triffids though . . .  other plants cannot walk or run.
 

Do not be a tease. This mistake google.


"Of course, the intervention improved, but as you have dozens of items daily, so bugs can escape the attention."

In Polish language, "these flowers" is a mild term, like something is cranky.


Now understand, and maybe even have to explain something?

Reason: