Trades opened in MetaTrader4 and MT4 engine in SQX is different



My Goal:
I want to make sure that result of MT4 and SQX is the same exactly.


How i test:
1. XAUUSD forex 2015-2019 &  lmax broker MT4
2.Export data to MT4  with no swap & commission => you can download my property file 
3.retest a XAUUSD strategies in 2015-01-01 ~ 2019-01-01 => H1 timeframe
4.Now i can compare the netprofit to check if the result is the same
5.found netprofit is different
6.because some trades is different (using excel to compare), the trade show in screenshot is one of them (please refer the attached file)


p.s. you can retest strategy during 2016-03-01 ~ 2016-03-20, there is a trade i found is different


finally, If backtest engine have issue, all robustness tests is not believable...


I have a suggestion, 
prepare an unit-test for backtest engine, 
 if you had modified the related code, run the unit-test first before releasing a new version, 
it's make sure the backtest engine is work fine





Attachments
Project_config.cfx
(3.47 KiB)
111.jpg
(215.57 KiB)
XAUUSD_Strategy 16170.sqx
(11.33 KiB)
lmax_backtest_verify.properties
(39.20 KiB)
  • Votes +4
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

sm
#1

samuel

20.04.2019 19:24

Task created

sm
#2

samuel

20.04.2019 19:28

Attachment 222.jpg added

uploaded the MT4 result for comparison
m
#3

mabi

21.04.2019 00:55
Voted for this task.
o
#4

Enric

23.04.2019 08:14
Voted for this task.
m
#5

Martin

27.04.2019 22:38
Voted for this task.
Dw
#6

Diwi

29.04.2019 11:56
Voted for this task.
TB
#7

Tomas Brynda

29.04.2019 15:33

Status changed from New to Fixed

Attachment XAUUSD_Strategy 16170.sqx added

Attachment Strategy Tester_ SQTest.html added

I made a test in SQX and MT4 and the results are equal (except to very little differences in price).

Both retested SQX strategy and html report are attached, you can check that

sm
#8

samuel

29.04.2019 18:34

I know there is slight different because of precise of value of indicator,

So the solution will release in build 121 ? Or the bug you can't duplicated it again?

i suspect that you fixed it, so change the status to fixed




TB
#9

Tomas Brynda

29.04.2019 19:34
Right now, it's hard to tell what caused the different results. 

We made some improvements in MQL and SQ code recently, so maybe it fixed that. But most of the time it's just about the correct data and settings.

 

sm
#10

samuel

30.04.2019 05:33

um....you don't find the root of cause

it's very clear problem for me

The trade is no show, but the upper shadow of bar at 2006/03/11 01:00 must be triggered the buy stop order to open

it's no doubt...

If the build 121 is released and the bug would be existed...I still have to report it again then...And you have to check that again...


Have you checked the things as below? 

1.check if the buy stop order is opened or not in MT4 engine

2.If it's existed and don't be cancelled, checking why that trade don't open at 2006/03/11 01:00?

i suspect that you already check the two i listed and still can't find the problem.


Finally, i just want to make sure the problem will no show at build 121...

Do you ever have compared the two versions (build 120 & the version you said that have some improvements), Is there any difference ?

Is the bug existed in build 120 in your side and fixed in improved version ?


Thanks for you take care about this issue


sm
#11

samuel

01.05.2019 17:33

Finally, i just want to make sure the problem will no show at build 121...

Do you ever have compared the two versions (build 120 & the version you said that have some improvements), Is there any difference ?

Is the bug existed in build 120 in your side and fixed in improved version ?

TB
#12

Tomas Brynda

02.05.2019 08:58

Attachment SQ_TickDataExportEA.mq4 added

Ok I must apologize, because earlier I made tests on H4 TF, I haven't realized you used H1.


I tested the strategy again on H1 and got the same problem as you did. I digged deeper and took a look on individual ticks in MT and SQ and I found the ticks are somehow not correct.

I contacted the rest of our team and we found bug in our MT export function. Now it works better but for some reason the spread isn't applied for XAUUSD symbol.

We must investigate this problem further. But the important thing is that the strategy works correctly in MT4 and SQ. The problem lies in the data export to MT4.


You can export the exact tick data from your MetaTrader installation using our tick data export EA. Then when you import it into SQ and retest the strategy on this data, you should get matching results.

We are currently working on the export and will fix it asap.


sm
#13

samuel

02.05.2019 09:04
Thank you for all your assistance !!!

I'll try it

TB
#14

Tomas Brynda

02.05.2019 09:23
You are welcome. Thank you for your report, it helped us discover the export problem.


If you need any further assistance, just let me know.

TB
#15

Tomas Brynda

02.05.2019 11:58
Yes, exactly, you just run it as a normal strategy in strategy tester and after backtest there will be a csv tick file created inside tester folder (MetaQuotes\Terminal\XYZ\tester\files)

Votes: +4

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please