Portfolio Trader Genetic Opt Metric Recommendation

Questions about MultiCharts and user contributed studies.
shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Portfolio Trader Genetic Opt Metric Recommendation

Postby shane1800 » 07 Jan 2016

Hi,

I'm sure this has been covered before but I'm still pretty new to this.

I currently have two strategies in the Portfolio Trader that I’m not going to change.

I have a third strategy that I’m genetically optimizing and my ideal system it finds would not increase negative drawdowns but just increase net profit. Or ideally the drawdowns would run opposite to the other two strategies and also have a good consistent curve of profit.

I see the standard ways to optimize. And also have tried optimize by curve. I see people have made others.

Optimize by equity curve.
viewtopic.php?f=5&t=11769

And see that I can have script made to create custom metrics like net / max drawdown.

What would you use for this situation?

Thanks in advance.

shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Re: Portfolio Trader Genetic Opt Metric Recommendation

Postby shane1800 » 22 Jan 2016

It looks like I can select Custom Fitness Value so I've been using the Optimize By Equity Curve but notice it only displays the value for that individual strategy and not all the strategies in the portfolio. Is there a way around that as Portfolio Trader is not very helpful if I cannot optimize strategies using metrics to compare themselves to the portfolio.


Strategy 1
Symbol 1

Strategy 2
Symbol 1

Strategy 3
Symbol 1

Strategy 4 - Optimizing
Symbol 1

I'd like to optimize #4 and have it make opposite drawdowns to the other strategies.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Portfolio Trader Genetic Opt Metric Recommendation

Postby TJ » 22 Jan 2016

Just a note...

Before you go any further, I just want to make sure
you do understand that applying 2 strategies to the same symbol will result in netting of the orders.

ie if strategy #1 goes long and strategy #2 goes short,
you will have a flat position,
not one long and one short.

shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Re: Portfolio Trader Genetic Opt Metric Recommendation

Postby shane1800 » 22 Jan 2016

Yes I know. I'm trading one symbol but under multiple accounts.

So in PT I have them listed separately under the Portfolio Tree.

shane1800
Posts: 84
Joined: 28 Feb 2014
Has thanked: 5 times
Been thanked: 5 times

Re: Portfolio Trader Genetic Opt Metric Recommendation

Postby shane1800 » 25 Jan 2016

Someone is helping me with this code, testing to see if it makes a difference.

Code: Select all


variables: peq(0), n(0), dlta(0), mean(0), m2(0);

peq = Portfolio_NetProfit + Portfolio_OpenPositionProfit;

// https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Online_algorithm
n = n + 1;
dlta = peq - mean;
mean = mean + dlta / n;
m2 = m2 + dlta*(peq - mean);

if LastBarOnChart_s then begin
if n < 2 then
SetCustomFitnessValue(-100500)
else
SetCustomFitnessValue(SquareRoot(m2 / (n - 1)));
end;


Return to “MultiCharts”