Optimization of trading system inclusion in portfolio

I was naively hoping I would be able to do some (approximately) optimal inclusion/exclusion/selection of systems in portfolio.

I have 100s of systems and thought I could get away with something like:

...
OptimizerSetEngine("cmae");
...
useSystem1 =  Optimize("Use System 1", 1, 0, 1, 1);
useSystem2 =  Optimize("Use System 2", 1, 0, 1, 1);
useSystem3 =  Optimize("Use System 3", 1, 0, 1, 1);
useSystem4 =  Optimize("Use System 4", 1, 0, 1, 1);
...
useSystemN =  Optimize("Use System N", 1, 0, 1, 1);
....

sumOfSystemsToUse = useSystem1  + useSystem2 + ... + useSystemN;

SetOption("MaxOpenPositions", sumOfSystemsToUse );

if (useSystem1 == 1) {
    #include "path/to/formula/for/system1"
}

if (useSystem2 == 1) {
    #include "path/to/formula/for/system2"
}
...
if (useSystemN == 1) {
    #include "path/to/formula/for/systemN"
}
...

But, of course, this doesn't work since it takes ages with exhaustive optimization and based on How to optimize trading system (yes, I did the RTFM!) binary inclusion/exclusion is not suitable for non exhaustive optimization approaches.

And I don't know how to dynamically change MaxPositions being equal to number of systems selected. One alternative would be, of course to also optimize for MaxPositions...

How to approach this kind of "portfolio" "optimisation"/selection of multiple strategies in Amibroker?

Thanks.

Run them in sequence. Then combine results off-line.

1 Like

@kktrader Get away with? I would advise you not to do this. I'm not even sure what you would glean from this exercise either. as it would have little, or anything to do to do with real-world application. I could go on an on, but to give a quick snippet, ff you can't move thru time, across all systems (as it happens in real life), then you can't simulate allocated funds and re-balancing between systems, which is under cash and margin constraints by the way. Then from there, specific system's dynamic symbol selection, risk per trade, risk per position, risk per systems portfolio, aggregate risk across all systems all systems at any point in time, or correlation of positions within a system and between system positions. Tracking reserve equity as if all positions across all systems got stopped out. Suffice to say, when a system (moving thru time) gets a signal to put on a position in something, if it violates a systems heat (Risk ceiling), you could exit a position somewhere else from that system or reduce trade size from a position or all system positions, to free-up risk to take that new position. You can only do this as you move thru time making decisions. This is like a living, breathing organism, with biological organs, chemistry, interplay and function, that when simply adding equity curves together cannot even approach reality. It's some very cool stuff. One other thing to spark your thoughts a bit, systems reduce bets and size as they loose (anti-Martingale), while re-balancing between system allocations is the opposite (Martingale). Bottom-line, is that you need proper architecture to do this cooking. Full stop.
A holiday present to you, you're welcome. :upside_down_face:

2 Likes

Thanks for your valuable answer.

Let me give a brief overview about the trading systems. They are simple. In major ETFs. Each system corresponds to only one symbol(ETF). There are way more long than short systems. I can have many or just a few systems in one ETF (more systems for major ETFs like SPY, QQQ, TLT). Majority of the systems are some sort of mean reversion buying into weakness. Now I trade all systems with up to max 60 simultaneous positions to max 130% of account net liquidation value so single position size is 130/60=2.17%.

My average exposure is small. When there are major sellofs in major indices then I get high exposure. I want to get a higher average exposure and thus higher returns. Now this is easily doable if I just lower number of max concurrent exposures and increase concentration.

I was wondering if a selection within the portfolio could achieve a higher exposure and "better" results by doing some sort of walk forward optimisation (in the same way as ranking, but here it is just inclusion/exclusion of a system in a portfolio at a particular point in time). Because each of the systems stands on its own. Combining them in the portfolio in some approximately optimal way is hard.

So, there is a path dependent path here which is hard to simulate. I have a feeling it is not that complex as you laid it out since the trading systems are not that complicated...

My pleasure, cheers, it sounds like you know what you are and aren't looking at. Good luck.