experimental portfolios

i tested for some time the new features in B128



for example i merge 5 same strategies, every strategy has set EOF to 19 hours - but in the mql code is nothing - exit friday was set to FALSE - so the trading options are not correct


every strategy has his own magicnumber, but in the MQL code is set the magicnumber only for first strategy and other strategies has different magicnumbers like 11112


extern int MagicNumber = 171514173;
bool LongEntrySignal = false;
bool ShortEntrySignal = false;
bool LongExitSignal = false;
bool ShortExitSignal = false;
extern int MagicNumber2 = 11112;
bool LongEntrySignal2 = false;
bool ShortEntrySignal2 = false;
bool LongExitSignal2 = false;
bool ShortExitSignal2 = false;
extern int MagicNumber3 = 11113;
extern int MagicNumber4 = 11114;
extern int MagicNumber5 = 11115;
bool LongEntrySignal5 = false;
bool ShortEntrySignal5 = false;
bool LongExitSignal5 = false;
bool ShortExitSignal5 = false;


if i use custom blocks in the strategies, the merging ends with error

Attachments
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

h
#1

hankeys

25.05.2020 20:58

Task created

h
#2

hankeys

25.05.2020 20:58
Voted for this task.
h
#3

hankeys

25.05.2020 20:59
and ensembled merging...try to make ensemble portfolio from 2 strategies and maket 2 combinations with different exit strategy - i did not respect what is chosen as exit strategy
h
#4

hankeys

25.05.2020 21:08

Attachment ptf2.jpg added

Attachment graf1.jpg added

but the worst part is that the backtest doesnt work good - i am using tick data suite and EQ from MT platform is totally different
h
#5

hankeys

25.05.2020 21:28
and the "portfolio" merged cant be retested in SQX - its only black box with N/A values
h
#6

hankeys

25.05.2020 21:56
and another basic thing that we need something for netted MT5 for trading futures symbols as a portfolio...


make a netted portfolio from strategies - simulate backtest by netted method and make MQL code from it - so i can trade more symbols at once and will now how the portfolio will historically behave in netted mode

h
#7

hankeys

25.05.2020 21:59
and finally without tool which tells me if the ensemble system is worth it - i cant imagine why to use this fuzzy logic "portfolio", and whats behind it and who decide it to add
Rr
#8

Partizanas

25.05.2020 23:25
Voted for this task.
TB
#9

Tomas Brynda

15.06.2020 07:47

Status changed from New to In progress

Summary:

  1. Trading options not applied
  2. Preset magic numbers not respected
  3. Custom blocks support
  4. Chosen exit strategy not applied
  5. Different backtest results
  6. Netting/hedging portfolio backtest feature request
Portfolios retesting - this is not possible in SQ right now. Portfolio functionality was intended to merge equity curves, compute correlation etc. Retest functionality is not supported right now
TB
#10

Tomas Brynda

17.06.2020 07:50

Status changed from In progress to Fixed

Ok, all problems fixed.


I would like to clarify the intended use of the portfolio strategies:

  • Simulated portfolio - a simple portfolio made by merging individual strategies' statistics into one overall result. It is useful when you want to see how your strategies behave as a portfolio. It is not backtestable.
  • Strategies merged to one - here we create a special strategy that contains rules from all the containing strategies. Is not backtestable, but the source code can be run in trading platforms. If the individual strategies don't interfere with each other (e.g. don't contain blocks like Market position is flat, No trade recently closed etc.), it should give you the same overall result as if you create a simulated portfolio.
  • Ensemble signals - we choose one strategy whose order handling logic will be preserved in the final portfolio strategy. Than we combine all entry and exit conditions from the merged strategies into fuzzy logic and we set a treshold percentage. It creates a brand new strategy, that is fully backtestable and also the source code can be run in trading platforms

I hope it's clear. If you have any further questions, please let me know.


Best regards,

Tomas 

h
#11

hankeys

18.06.2020 14:37
for me its clear, but sometimes i am not get it whats behind it...OK


Simulated portfolio - nonsense info about that its a ensemle strategy, thats not true - see the picture


Strategies merged to one - OK, first try to merge strategies to one MQL file with some limitations. We will see if the backtest will be accurate in the next build - need to do very extensive testing to prove this...


Ensemble signals - whats behind it, i really dont know - combined entry logic to fuzzy and rest from one choosen strategy - what tool gives me the answers which strategies should i try to combine and which one choose as the exit one? we dont have any. And this method is by my opinion misunderstood - ensemble signals should work like this - i have 5 strategies, 4 of them tells me - open BUY, 1 tells open SELL - so 4 buys and 1 sell by the logic of the strategies. 4 buy wins, so the sell will not be open, there is low probability, that the market will go short, because 4 strategies are telling long. But this fuzzy logic we created is totally different world, it has nothing to do with ensembled signals as i see them


So ensembled signals should lead to 2 things - trade less and profit more, this what we have will not

h
#12

hankeys

18.06.2020 14:38

Attachment ptf.jpg added

ptf.jpg
(94.24 KiB)
picture
h
#13

hankeys

18.06.2020 14:39
and Strategies merged to one - missing the basic info, that the combined strategies need to have the same MM and same trading options
h
#14

hankeys

18.06.2020 14:47
and we the most need some solution for MT5 netted accounts


this is the right place for using the "strategies merged to one" but SQX need to show us the historical results of the trading, because the trades will be handled differently

h
#15

hankeys

20.06.2020 11:23

Attachment merge.jpg added

merge.jpg
(84.73 KiB)
if i want to merge my portfolios to "ptfs" databank and i need everytime choose the ptfs databank in this popup


SQX should remember my settings, so i dont need to change it manually everytime...


thx for this 

m
#16

mabi

22.06.2020 03:39

Strategies merged to one - here we create a special strategy that contains rules from all the containing strategies. Is not backtestable, but the source code can be run in trading platforms. If the individual strategies don't interfere with each other (e.g. don't contain blocks like Market position is flat, No trade recently closed etc.), it should give you the same overall result as if you create a simulated portfolio.


Is it possible to have all strategies use the same magic number ( Should not be a problem if diversified, plus you can split it on long and short leg only in MT4) or will that create a problem when it comes to individual exits.  What i really want is to have all trades show up as it comes from one magic number.

E
#17

Emmanuel

22.06.2020 16:44
Voted for this task.
TB
#18

Tomas Brynda

24.06.2020 10:18
Hankeys - added it as a new feature here https://roadmap.strategyquant.com/tasks/sq4_6565


Mabi - If the strategies had the same magic number, they would enterfere with each other. The individual exits would not be respected. I suggest using a magic number in some range (e.g. 10000 - 10010) for the merged portfolio. Then you will be able to tell which orders belong to which individual strategies inside the merged strategy and also which orders belong to the whole merged EA.

h
#19

hankeys

24.06.2020 10:57
but if i have the magicnumbers already in the SQX files of individual strats, it should use them - and its not happening either
TB
#20

Tomas Brynda

24.06.2020 13:23
Hankeys - this has been already implemented. You can find it in the upcoming release. 

The algorithm works in a way that it gets the preset magic number of the merged strategy and if it is unique, it leaves it as it is. If the magic number is already present in one of the merged strategies, it generates a new one to prevent any unwanted interference.


Votes: +3

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please