How are multiple orders in the Strategy Tester treated in MQL5?

 

Hi,

I'm using MQL5.

When running my back tester I'm doing the following.

Example (see below for a screenshot):

  1. Open Trade1 SL=100 with volume=0.01
  2. Open Trade2 SL=150 with volume=0.01
  3. Open Trade3 SL=200 with volume=0.01

I then run in the strategy tester.

The price then rises in the strategy tester. And the following happens:

  1. At Price=100 it ignores Trade1's SL
  2. At Price=150 it ignores Trade2's SL
  3. At Price=200 it sells all three trades at Trade3's SL

I would expect this to have sold Trade1 at 100, Trade2 at 150 and Trade3 at 200.
The history of the back testing is attached to this post as an image.

Questions:
  1. Am I missing something here or is this the way it works?
  2. If this is the way it works does it work in live trading like this or is it just a strategy tester thing?
  3. What can I do to get the behavior I want (i.e. selling at each trade's SL, I'm thinking of putting in one order or 0.03 and then selling off bits as the trade moves up of volume 0.01 per SL)

Thanks :)

Below is a screenshot of the Strategy Tester History. See how ticket 10, 11 and 12 each of volume 0.01 were merged into one and all sold at once with a volume of 0.09. I'd expect to get 3 sells with volumes of 0.01 not one sell with a volume of 0.09

History from the Strategy Tester

 
gr101:

Hi,

I'm using MQL5.

When running my back tester I'm doing the following.

Example (see below for a screenshot):

  1. Open Trade1 SL=100 with volume=0.01
  2. Open Trade2 SL=150 with volume=0.01
  3. Open Trade3 SL=200 with volume=0.01

I then run in the strategy tester.

The price then rises in the strategy tester. And the following happens:

  1. At Price=100 it ignores Trade1's SL
  2. At Price=150 it ignores Trade2's SL
  3. At Price=200 it sells all three trades at Trade3's SL

I would expect this to have sold Trade1 at 100, Trade2 at 150 and Trade3 at 200.
The history of the back testing is attached to this post as an image.

Questions:
  1. Am I missing something here or is this the way it works?
  2. If this is the way it works does it work in live trading like this or is it just a strategy tester thing?
  3. What can I do to get the behavior I want (i.e. selling at each trade's SL, I'm thinking of putting in one order or 0.03 and then selling off bits as the trade moves up of volume 0.01 per SL)

Thanks :)

Below is a screenshot of the Strategy Tester History. See how ticket 10, 11 and 12 each of volume 0.01 were merged into one and all sold at once with a volume of 0.09. I'd expect to get 3 sells with volumes of 0.01 not one sell with a volume of 0.09


Thats how it works in MT5.

Only one Position.

If you want Separate positions, Use MT4.

 
Marco vd Heijden:

Thats how it works in MT5.

Only one Position.

If you want Separate positions, Use MT4.

Thanks!