Optimization results mess when Portfolio Trader is used

Questions about MultiCharts and user contributed studies.
krzysiaczek99
Posts: 19
Joined: 23 Sep 2012
Been thanked: 2 times

Optimization results mess when Portfolio Trader is used

Postby krzysiaczek99 » 05 Jul 2023

After running optimization from Portfolio Trader for two different symbols as different strategies number of bug was encountered.

1) Seqential optimization is not performed i.e. for each strategy. Instead sort of combitional optimization between two strategies is done even those strategies are separate (see setup screen). Using strategy with two symbols gives also messed optimization results.
2) Custom fitness value is set inproperly - always last value is used even print from EL code gives two symbols

Code: Select all

Inputs: RSILength(14); Vars: oResult1(0), ObLevel(0.8), OsLevel(-0.8), Price(0), Price1(0, Data1);// Price2(0, Data2); Var: name(""), cf_val(0); Price = Close; if CurrentBar = 1 then begin name = getsymbolname; if name = "AUDJPY" then cf_val = 1; if name = "USDJPY" then cf_val = 2; SetCustomFitnessValue(cf_val); print(name); end; oResult1 = JohnEhler_My_RSI( RSILength, Price ); if oResult1 crosses under 0 then SellShort("0crossSell") next bar at Market else if oResult1 crosses over 0 then Buy("0crossBuy") next bar at Market ; if oResult1 crosses under ObLevel then SellShort("ObCross") next bar at Market else if oResult1 crosses over OsLevel then Buy("OsCross") next bar at Market;
Attachments
opt_results.jpg
results with wrong custom fitness
(512.81 KiB) Not downloaded yet
simulations.jpg
wrong simulations number
(201.31 KiB) Not downloaded yet
setup.jpg
porftolio setup for optimization
(826.07 KiB) Not downloaded yet

User avatar
Kate MultiCharts
Posts: 597
Joined: 21 Oct 2020
Has thanked: 9 times
Been thanked: 148 times

Re: Optimization results mess when Portfolio Trader is used

Postby Kate MultiCharts » 07 Jul 2023

Hello krzysiaczek99,

That’s expected behaviour.
If you’d like to optimize two strategies separately, you’ll need to put them into separate Portfolio windows.
Having separate strategies in the same Portfolio window allows using different signals or broker accounts for specific symbol sets. But Money Management logic is the same for, and MM signals are applied to all the strategies within one Portfolio window.
The number of combinations is also correct: it’s 3x3=9.

krzysiaczek99
Posts: 19
Joined: 23 Sep 2012
Been thanked: 2 times

Re: Optimization results mess when Portfolio Trader is used

Postby krzysiaczek99 » 08 Jul 2023

Hello krzysiaczek99,

That’s expected behaviour.
If you’d like to optimize two strategies separately, you’ll need to put them into separate Portfolio windows.
Having separate strategies in the same Portfolio window allows using different signals or broker accounts for specific symbol sets. But Money Management logic is the same for, and MM signals are applied to all the strategies within one Portfolio window.
The number of combinations is also correct: it’s 3x3=9.
HI,

Is not really true what you are saying, If you mark one strategy in Portfolio window than you can optimize and backtest one, if you mark two for different symbols, you can make combined backtest for two strategies and in report split them per symbol. But optimization is done differently. When
two strategies are marked, instead of sequential optimization strategy by strategy like in backtest, it makes it like a combination of all parameters from those strategies so its inconsistent with the way as backtest is done.

So it is possible to make automated sequential optimization for different strategies like in backtest or not ? Obviously by changing of dataindex it doesn't work.

Krzysztof


Return to “MultiCharts”