[121]MT4 engine & metaTrader result is different

  1. I export data from SQX to metatrader using property file i uploaded, but there is a bug about exporting data to metatrader, so go to step 2
  2. In order to make sure the data is the same, I dump data from metatrader using the SQ_TickDataExportEA and import to SQX as a new symbol for retesting
  3. using the new symbol retest a strategy
  4. retest the strategy from 2015/01/01 - 2015/12/31, but the result between metatrader and MT4 engine is different


 the result of strategy between the two is still different(Not slight different only)


p.s. i had followed the step written in https://strategyquant.com/doc/reliable-backtesting-in-metatrader/

Attachments
lmax.properties
(39.19 KiB)
  • Votes +6
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

sm
#1

samuel

06.05.2019 16:39

Task created

sm
#2

samuel

06.05.2019 18:42

Description changed:

  1. I export data from SQX to metatrader using property file i uploaded, but there is a bug about exporting data to metatrader, so go to step 2
  2. In order to make sure the data is the same, I dump data from metatrader using the SQ_TickDataExportEA and import to SQX as a new symbol for retesting
  3. using the new symbol retest a strategy
  4. retest the strategy from 2015/01/01 - 2015/12/31, but the result between metatrader and MT4 engine is different


 the result of strategy between the two is still different(Not slight different only)


p.s. i had followed the step written in https://strategyquant.com/doc/reliable-backtesting-in-metatrader/


sm
#3

samuel

06.05.2019 19:47

Attachment GBPJPY_Strategy 2171043_result_diff.sqx deleted

sm
#4

samuel

06.05.2019 19:48

Attachment diff_spp_mc_GBPJPY_Strategy 1221394.sqx added

Attachment diff_spp_mc_GBPJPY_Strategy 4121008.sqx added

Attachment diff_spp_mc_GBPJPY_Strategy 2171043.sqx added

uploaded strategies
o
#5

Enric

06.05.2019 19:54
Voted for this task.
Dw
#6

Diwi

08.05.2019 12:22
Voted for this task.
m
#7

mabi

15.05.2019 02:47
Voted for this task.
TB
#8

Tomas Brynda

16.05.2019 09:43

Status changed from New to Waiting for information

Attachment diff_spp_mc_GBPJPY_Strategy 4121008.sqx added

Attachment Strategy Tester_ diff_spp_mc_GBPJPY_Strategy 4121008.html added

Hi samuel,

I tried to retest the attached strategies in SQ and MT. To get matching results i had to do the following:

  • Export my dukascopy data from SQ to MT using DataManager export function
  • Retest strategy in MT using actual spread
  • Export tick data from MT and import it into SQ
  • Retest strategy in SQ using Real tick real spread precision

Then the trades and equity curves are equal (only PL differs - it depends on point value setting).
You can check the attached sqx file and html report. I tested the strategy on EURJPY, but it should not matter.


Please let me know if this technique works for you too.


We will try to improve the data export to MT4 until next release. MetaTrader handles the exported data somehow strangely and the spread setting doesn't work.



sm
#9

samuel

16.05.2019 19:59

Attachment diff.xlsx added

I want to say "it should matter"


You should duplicate it in exactly same setting...(btw  i'm a software engineer, so i know the debug process  when user report a issue that can be duplicated)


Now i have to use the EURJPY that you had tested, it waste my time to duplicate issue again...


  •  you have to use longer test period, at least 5 years
  • there is a excel i had compared the two results using EURJPY
  • the row highlight in red color is different, and there is a trade isn't opened during 2017

1. It's just the issue that i found on EURJPY, and i'm not sure if the isuue on GBPJPY is same on EURJPY.

2.After you check and fixed the issue on EURJPY, please test on GBPJPY and make sure that's the same issue


Thanks

d
#10

Dave

17.05.2019 00:19
Voted for this task.
f
#11

felipebr

19.05.2019 17:13
Voted for this task.
TB
#12

Tomas Brynda

21.05.2019 14:29

Status changed from Waiting for information to In progress

Attachment results.zip added

Hi Samuel,

I tried to backtest the strategy on 5 years of history data (2014 - 2019). There are slight differences in prices which may be caused by some inside rounding operations.

Maybe those few trades are missing because of that. I will have to debug it more deeply and solve the tiny price offsets.


I will let you know when it's fixed and I will also retest it on GBPJPY data as well.


I attach my SQ and MT results if you want to take a look and compare. No big differences


Tomas

sm
#13

samuel

21.05.2019 17:29
If it exactly the rounding issue, it's no matter.


we don't have enough information to verify if it just rounding issue => pending order is no show in SQX chart


I worried about it might be caused by other issue..


thank you very much

TB
#14

Tomas Brynda

04.06.2019 17:04

Status changed from In progress to Fixed

Attachment results_gbpjpy.zip added

I have found the cause of the rounding issue and fixed it. It will be working fine in the next release.

I made tests on EURJPY and GPBJPY, both on 5 years of data, and all trades were equal.


The missing pending orders may have been caused by incorrect min. distance setting in SQ.


My results for GBPJPY are attached.

rr
#15

Ronen

05.06.2019 19:28
Voted for this task.

Votes: +6

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please