Best language/structure for portfolio opt

@guru thanks for feedback, i understand. Despite this, one has to decide which strategies to run or take out of a portfolio. So how have you solved the problem?

Thanks for structure/language recommendation.
 
@fan27 thanks for feedback, My approach is to diversify and smoothen out my equity curve of my portfolio by using multiple markets in my case, ES, CL, NG, S, SI. My risk approach is to have a maximum risk per market to 1% of my portfolio If all strategies per market trades at the same time, my risk allocation per strategy is 0.25% and i use 4 strategies max per market.

If i would do it as you, which would be ranking between signals, which i could easily setup to , but, then again the issue comes in about ranking based on previous performance, which in turn leads in to the question if picking strategies signals based on previous performance is a good thing to do. Perhaps i misunderstand though. Do you randomly exclude signals between your signals or how do you chose if you for example has N as max trades per group and you get signals exceeding this N amount ?

My approach was to find a way to vet out the least performing ones, (which i initially planned every quarter) but as globaltrader kindly pointed to, was not optimal. so kind of back to drawing board and appreciate your thoughts on best approach. Not looking for anything super optimised but rather a robust and simple solution.

Thanks
It is very hard to take signals based on strategy ranking because what do you do technically when strategies of different ranking fire off trades at the same time? I just take signals/trades as they come in and once I reach the max, I skip the proceeding trades.
 
@fan27 i understand, however i assume you must have a process/definition of which trade to take if you get multiple signals at the same time? if not then i assume its just decided randomly? perhaps this is not an issue at all for you due to all different strategies and timeframes.

I was thinking of going this route also, but decided to quantify the process of vetting out the strategies to run live in portfolio over a longer timeframe, and due to this gradually phasing out "non performing" ones.

However after todays discussion here, i might have to rethink, lots of people with much more knowledge and experience than myself in this thread:)

Thanks for commenting
 
@fan27 i understand, however i assume you must have a process/definition of which trade to take if you get multiple signals at the same time? if not then i assume its just decided randomly?
As previously mentioned, I take trades as they occur and record trade candidates in shared memory so I do not have to wait for orders to actually fill before I begin skipping trades. I should have the new version of FasterQuant ready tomorrow. I recommend you request a trial and see how I am solving these problems as application source code is provided and you can see my AlgoTerminal implementation.
 
Yes you need to decide what you mean by not performing, and from that you can determine whether 100 trades is sufficient to make that decision. This will depend on your confidence interval; do you want to be 95% certain that a strategy is not performing? 99%? 75%?

Why do you need more capital to run more strategies?

GAT

@globalarbtrader again thanks for commenting, may i kindly ask you about how you would go about a few things...
1: So lets say i decide that "not performing" is a 50% drop in profit factor or sortino ratio of the strategy, how would you go about to determine what would be a needed amount of trades to determine this?

2: If i would say want a confidence level of 95% that my strategy is not performing, are you referring to a monte carlo analys of the above mentioned amount of trades to determine this certainty level?

3: you ask me "Why do you need more capital to run more strategies?" shall i understand this as you are preferring same as fan27 that you let all strategies run on same symbol, and then just limit max trades at the same time without no preferred ranking for the signals?


My limitiations are
i have a fixed stop per strategy, i would like to positionsize to 0.25% risk of my capital per strategy and trade, and max 4 open positions on same market.

How would you go about solving the problem? rank strategies to run max4 live, rank signals to max 4 same time from all strategies run live? or another way?

Thanks for taking the time to reply
 
@globalarbtrader again thanks for commenting, may i kindly ask you about how you would go about a few things...
1: So lets say i decide that "not performing" is a 50% drop in profit factor or sortino ratio of the strategy, how would you go about to determine what would be a needed amount of trades to determine this?

2: If i would say want a confidence level of 95% that my strategy is not performing, are you referring to a monte carlo analys of the above mentioned amount of trades to determine this certainty level?

Yes basically, although you could also work it using some standard statistical techniques.

For example if your annual Sharpe Ratio was 1.0 and your risk target was 10%, then that works out to roughly 0.1% expected profit and 1% standard deviation per trade (with a lot of assumptions). The t-statistic is mu - m0 / s.e. (mu), and the s.e. for mu is sigma / root(N). So the t-statistic is (mu - m0) *root(N) / sigma.

mu = 0.05% (half our expected profit)
m0 = 0.1% (expected profit)
sigma= 1%
N is unknown
Confidence threshold for T is C, which is a function of N

So we have[switch mu and m0 round for convenience)

0.1% - 0.05% *root(N) / 1% = f(N)
root(N) = f(N)*1% / (0.1% - 0.05%)= f(N) * 20

Approximate 5% critical value for large enough N (f(N)) is 1.67

root(N) = 1.67*20 =33.4
N = 1115

You would need 1115 trades, which would take about 11 years. Now can you see why I think this exercise is futile?

Incidentally if your expected Sharpe Ratio is 2.0 (which I'd think is a bit optimistic for an individual trading rule) you would 'only' need 278 trades. Again this would take about 3 years.

[Alternatively, if am allowed a plug, there are tables in my latest book that work this stuff out for you]

Footnote: the above assumes Gaussian returns. If your trades are very positive skew (lots of losses, fewer wins, high win:loss ratio) you would need slightly fewer trades; and if you had negative skew (the reverse) you would need a lot more.

3: you ask me "Why do you need more capital to run more strategies?" shall i understand this as you are preferring same as fan27 that you let all strategies run on same symbol, and then just limit max trades at the same time without no preferred ranking for the signals?

No, I run my system quite differently and my solution won't be appropriate for a more short term system.

However if I did use a system like yours I would indeed take an approach of limiting maximum trades, and if multiple trades 'fired' at the same time I'd pick the one with the strongest signal.

GAT
 
@globalarbtrader Thank you very much. Your examples indeed provides some clarity to why you reason as you do. I am back to drawing board it seems.

Btw i have bought all your books, and going to get the latest one, so shall be interesting to read about what you refer to, thanks for pointing it out.

I am fighting quite hard with myself with the idea to run all strategies same time and set a max signal rule.. and as you say, pick the ones with strongest signal.

For me based on a pure logical perspective "not proven" is that if i go this route, since very often signals are quite clustered and large winners tend to come even more clustered.. it means that i would take lots of trades spread out, but the winners are limited... i also running into the issue that strategies would be difficult to compare to backtests and reality, since i would take just some signals from a strategy but not all, etc... lots of issues with this.. i assume i have to back up my assumption with some evidence before i argue for it further :) .. but its just my personal initial thougths of it.

Anyway, i still need to define a rule for my meta rule system in terms rebalancing of strategies to run, from a library of them, then a rule for how often to rebalance them and how.

Its a difficult nut to crack :)
 
you
I’m dealing with similar issues and I have a few million strategies that never had a losing year since 2007, and many never had a losing month (most are variants of other strategies so each one isn’t fully unique). However, about 30% of those strategies (and their combinations) will stop working the following year, despite being profitable during the past 12 years, and despite some being profitable every month (simply because I can fit/overfit strategies to any level I want). And some that worked 10 years ago may start working again tomorrow.
So now imagine using only last year or last quarter to evaluate future performance...
You’re simply pointing the problem that everyone has with strategy selection.
But in terms of your core question, I think that most people here use C# and others Python, so these would be couple great choices. You may want to Google topics such as “portfolio optimization Python” to find plenty of examples.
do the strategies talk to each other much in combination or you just summing them up. you could look at how the returns vary for small changes in the parameters. one might expect some continuity at least on some subset like a neural net or summin
 
you
do the strategies talk to each other much in combination or you just summing them up. you could look at how the returns vary for small changes in the parameters. one might expect some continuity at least on some subset like a neural net or summin

I would even take a go at event analysis -- taking a truly abnormal event (or even a new crisis that you think might repeat into a pattern 'going forward...'), and take a stab at that reactivity.
Maybe call it, "Tweet Storm" -- I'm sure that name is not in use... :confused::wtf::D
 
Back
Top