Critical differences between mt4 and sq (attached strategy + possible causes of these problems)

Using the same configuration in the mt4 terminal and in sq for some strategies the results are very different. For the attached strategy Mt4 does not do correctly the calculation of risk and lotaje in addition to the big difference in the orders. The data for the backtest of mt4 are exported to the installation folder through strategyquant. Attached are photos of the results, settings and strategy. 
Attachments
EU15M V 213159.sqx
(413.43 KiB)
  • Votes +4
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

m
#1

Martin

31.12.2018 10:06

Task created

m
#2

Martin

31.12.2018 10:07

Attachment MT4ORDERS.jpg added

Attachment MT4 SETTINGS.jpg added

Attachment SQ4 ORDERS.jpg added

m
#3

Martin

31.12.2018 10:11

Attachment 10EU15MRESULTS RISK20.jpg added

Attachment 10EU15MRISK20.jpg added

Attachment 10EU15MRESULTS RISK10.jpg added

Attachment 10EU15MSETTINGS RISK10.jpg added

Attachment SQ10EU15MRESULTS RISK20.jpg added

Attachment SQ10EU15MRESULTS RISK10.jpg added

Attachment 10EU15M V 213159.mq4 added

Attachment EU15M V 213159.sqx added

Please note the big difference caused by the change from risk 20 per trade to risk 10 in mt4 compared to the difference in the backtest of sq. I attach the results and configurations in mt4 and sq together with the mq4 file exported by sq for the strategy and together with the strategy, which is the same as in the com.
m
#4

Martin

31.12.2018 10:22

Attachment NOTCLONEDDATAEURUSDEU15M V 213159.mq4 added

Attachment CLONEDDATAEU15M V 213159.mq4 added

Attachment CLONEDRESULTS.jpg added

Attachment NOTCLONEDRESULTS.jpg added

Attachment CLONEDNOTCLONED-EU15M V 213159.sqx added

Finally I want to add the difference that causes to export a strategy that has been tested with EURUSD downloaded by dukascopy and that same strategy if before being exported its symbol in sq was the EURUSD of dukascopy cloned to EST+07, with exactly the same parameters as for pip steps and so on. Using the same configuration in mt4 and the same symbol for both strategies, the one exported after being tested in EURUSD and the one exported after being tested in the cloned data, the results are very different. As you can see the difference is similar to the one that occurred when changing the risk adjustment from 10 to 20. I think these results may be due to some problem in sq when exporting properties or probably related to money management, it does not make sense to export the same strategy with different symbols but that its configuration of pips is the same get different results. To replicate the results of mt4 attached both strategies, the one exported in the EURUSD data and the one exported in the cloned data, just do the backtest of mt4 in 2018 for the eurusd with the same configuration for both experts.
IH
#5

clonex / Ivan Hudec

31.12.2018 11:27
Voted for this task.
m
#6

Martin

31.12.2018 11:59
I made the configurations of the symbol in mt4 correctly, so that you don't ask me to go to the strategyquant document to point 6.3 because I've already read this document and I've tested both exporting the data using the configuration of your script and exporting the data base of the dukascopy eurusd symbol as it is taken sq
m
#7

Martin

31.12.2018 12:24
Voted for this task.
m
#8

Martin

31.12.2018 12:41
Using a different broker I got very different results because of the EURUSD differences in their settings but still they are so different from sq results. I have tried everything I could think of but I can't get mt and sq matching results
TB
#9

Tomas Brynda

31.12.2018 15:57

Status changed from New to Fixed

Attachment screen.png added

Hi Martin,

thank you for reporting this issue. I tested your strategy and found a bug in MQL code. There was a buffer index missing in BBWidthRatio indicator call.

I already fixed that and it will be working in the next release. For a quick repair of your EA, modify its code as shown in the attached screenshot.


If you still experience some problems after fixing the MQL code, please let me know.


Best regards,

Tomas

g
#10

geektrader

31.12.2018 17:55
Voted for this task.
t
#11

tnickel

01.01.2019 05:54
Voted for this task.

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