MT5 Strategy Tester - Hedging/Netting Issue

 

I have just switched to an MT5  hedging account and it seems that the Strategy Tester either does not work correctly with it or I am doing something stupid....

A very simple EA that literally places a single pending order with a SL & TP it does nothing else at all, no other code, no indicators etc.

Netting Account:  (see picture)

Trade is placed with SL & TP

TP hit

Profit/Loss is calculated as the trade progresses.

So all is fine

Hedging Account: (see picture)

Trade is placed with SL & TP  

TP & SL are ignored 

Profit/Loss is not calculated at all


I've tried some other pieces of code as well, same result. 

I cannot seem to find anything here that talks about the strategy tester and the hedging account and if it should or shouldn't be treated differently etc.

Any ideas?

thanks

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
Files:
 
Paul Anscombe:

I have just switched to an MT5  hedging account and it seems that the Strategy Tester either does not work correctly with it or I am doing something stupid....

A very simple EA that literally places a single pending order with a SL & TP it does nothing else at all, no other code, no indicators etc.

Netting Account:  (see picture)

Trade is placed with SL & TP

TP hit

Profit/Loss is calculated as the trade progresses.

So all is fine

Hedging Account: (see picture)

Trade is placed with SL & TP  

TP & SL are ignored 

Profit/Loss is not calculated at all


I've tried some other pieces of code as well, same result. 

I cannot seem to find anything here that talks about the strategy tester and the hedging account and if it should or shouldn't be treated differently etc.

Any ideas?

thanks

That's obviously a bug, what MT5 build ? How to reproduce it ?

 
Alain Verleyen:

That's obviously a bug, what MT5 build ? How to reproduce it ?

Build 2361 & 2418

Run Strategy Tester with visual with code that opens trades.

I used attached completely simplified snippet of code in the end because I thought I was going crazy.

Thank you for your interest.

regards

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
Files:
 
Paul Anscombe:

Build 2361 & 2418

Run Strategy Tester with visual with code that opens trades.

I used attached completely simplified snippet of code in the end because I thought I was going crazy.

Thank you for your interest.

regards

Can't be reproduced.

Probably related to the broker and/or symbol with "-sb" suffix ?

 
Alain Verleyen:

Can't be reproduced.

Probably related to the broker and/or symbol with "-sb" suffix ?

Ok thanks for checking.

The account you used had hedging set? 

Brokers use lots of different suffix so it should be able to handle it, does that not still make it a bug given that brokers are allowed to use suffix?

regards

Paul

 
Paul Anscombe:

Ok thanks for checking.

The account you used had hedging set? 

Of course.

Brokers use lots of different suffix so it should be able to handle it, does that not still make it a bug given that brokers are allowed to use suffix?

regards

Paul

I didn't say it's not a bug. But if you want it to be fixed (or even only listened by Metaquotes), you have to show them how to reproduce it.

Give me all details needed to reproduce it please : broker, ST settings (ini file).

 
Alain Verleyen:
Of course.

I didn't say it's not a bug. But if you want it to be fixed (or even only listened by Metaquotes), you have to show them how to reproduce it.

Give me all details needed to reproduce it please : broker, ST settings (ini file).

Sure will do over the weekend now though left the office.  
Regards
Reason: