Portfolio - Merge Strat to one, trading in parallel - JPY strat discrepancy

Hi,


Not sure if it's a bug:
It seems the trade for JPY pairs are not correct when merged in a portfolio, the SL seems to be much smaller than if i run the strat by itself

I found that the same strat running in the portfolio uses 1 pip SL, and when it runs individually, it has 50 pips SL
It seems to be across the board for all the JPY strats i tested so far.
The portfolio was generated from b129 dev 6


If there's some settings i should be changing to make it work, please let me know.


Regards,
Simon

Attachments
AUDJPY_individual_180004056.jpg
(274.46 KiB)
AUDJPY_in_portfolio_180004056.jpg
(270.03 KiB)
  • Votes +5
  • Project StrategyQuant X
  • Type Bug
  • Status Duplicate
  • Priority Normal
  • Assignee Tomas Brynda
  • Milestone Build 130

History

t
#1

Simon

13.07.2020 09:03

Task created

h
#2

hankeys

13.07.2020 10:39
Voted for this task.
TD
#3

Tomas.D

13.07.2020 12:26
Voted for this task.
IH
#4

clonex / Ivan Hudec

13.07.2020 12:47
Voted for this task.
o
#5

Enric

13.07.2020 18:49
Voted for this task.
t
#6

Simon

14.07.2020 16:29

Attachment Combined_port_20200713_100.sqx added

Attachment 180004056_b128-multi2-Strategy 241421_AUDJPY_H1.sqx added

Combined_port_20200713_100.sqx
(3.01 MiB)
180004056_b128-multi2-Strategy 241421_AUDJPY_H1.sqx
(27.99 KiB)
added strats just in case if it's required
m
#7

mabi

16.07.2020 15:36
Voted for this task.
MF
#8

Mark Fric

16.07.2020 15:49

Assignee changed from Tomas Brynda to Tomas Brynda

Milestone changed from None to Build 129

m
#9

mabi

19.07.2020 00:37
Probably fails when order is modified and sl is set.
TB
#10

Tomas Brynda

20.07.2020 15:52

Status changed from New to In progress

Attachment Vystrizek.png added

Vystrizek.png
(84.11 KiB)
Hi Simon,

thanks for the attached strategies.


I can see that you combine strategies for various symbols. In this case you must set the right symbol names and tickSizes in the portofolio EA parameters.

Take a look at the screenshot attached. You should set Use SQ TickSize to true and check every chart if it uses the right ticksize.


Let me know if it helped.


Best regards,

Tomas

t
#11

Simon

21.07.2020 08:14
Hi Tomas,


Thanks for your response. I did actually change those to the right currency and also matched ticksizeSQ to 0.01 for the JPY pairs, and changed to use the  useSQticksize to true, before i raise this bug.

That didn't resolve the issue though.


Regards,

Simon

TB
#12

Tomas Brynda

21.07.2020 11:00

Status changed from In progress to Waiting for information

Attachment Combined_port_20200713_100.mq4 added

Attachment Combined_port_20200713_100.mq5 added

Combined_port_20200713_100.mq4
(567.95 KiB)
Combined_port_20200713_100.mq5
(686.91 KiB)
Thanks for your feedback Simon.


I went through the code and figured out there is an issue when checking SLPT price in MQL code.

Please try the modified EA code I attach, it should be working fine. And let me know if it helped.

m
#13

mabi

23.07.2020 10:42
Is there a new template available for this fix. I would like to try it building portfolios per instrument this coming weekend like 12 of them.
TB
#14

Tomas Brynda

23.07.2020 13:53

Attachment PortfolioFix.sxp added

PortfolioFix.sxp
(47.14 KiB)

Ok, import the attached file into CodeEditor and the templates will be fixed.

h
#15

hankeys

24.07.2020 07:44
i merged 25 strats to the portfolio - every strategy in the portfolio is using min. distance set to 5, but in the MQL code of the portfolios the min. distance is missing


double sqMinDistance = 0;

h
#16

hankeys

24.07.2020 08:00
and second one - if in the portfolio is only 5 markets i need to set for 25 strats whole 16 subcharts


because subchart is market+timeframe


so instead of 5 subcharts i need to set 16 for the portfolio of 25 strats trading only 5 markets

h
#17

hankeys

24.07.2020 08:12

Attachment Portfolio.mq4 added

Attachment critical.jpg added

Portfolio.mq4
(326.60 KiB)
critical.jpg
(161.30 KiB)
i run the backtest of the portfolio file, but in tick data suite i am getting those critical errors...in b128 the backtest runned but EQ curve goes to the hell


someone tested it? - using rc1 MQL code

t
#18

Simon

24.07.2020 08:21
Hi Tomas, i tried importing the fix in code editor (in b129 dev6), regenerated the merged portfolio (trading in parallel), changed symbol, admin distance, useSQticksize to true, checked ticksize is correct, but the trades in portfolio still giving huge lot size compared to the single strat running by itself.

Not sure if i applied the fix incorrectly or not?

Anyway to check if the fix has been applied?


I also tried the mq4 you generated, it seems to be fixed for most, except audjpy strat. However, it will be easier for me to compare if i can get the fix in code editor and be able to generate the modified mql4 codes for both merged, and single.

TB
#19

Tomas Brynda

24.07.2020 13:50

Status changed from Waiting for information to In progress

Hankeys:

  1. I just fixed the min distance, it will be applied from the first strategy.
  2. The critical errors are caused by MT getting zero ticksize, please check the symbol name in EA parameters and if it exists, it should not happen. Nevertheless I have added a fix, that will not try to correct the price if ticksize can't be obtained from MT.

Simon:

  1. You can check if the fix has been applied by finding a function double sqGetSLPTLevel in the generated MQL code and checking that there is this line present inside the function:
double pointCoef = sqGetPointCoef(symbol);


h
#20

hankeys

24.07.2020 17:25
symbol names are correct, i am trying to test on ICMarkets and this broker has no suffix or whatsoever...


could you also look at the number of subcharts - because there is too many of them - because the subchart is with timeframe as a combination

TB
#21

Tomas Brynda

11.08.2020 08:25

Milestone changed from Build 129 to Build 130

NH
#22

phl3x0r

22.09.2020 19:04
Hello.


I have tried to get this working for a while now and failed every time.

I can't get any portfolio working in MT4 (Oanda) backtests.

Backtesting single strategies seems to work fine, but not portfolios (I have also tried the ones posted here).

What could be the issue?

TB
#23

Tomas Brynda

27.11.2020 11:40

Status changed from In progress to Duplicate


Votes: +5

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please