Best language/structure for portfolio opt

Discussion in 'Automated Trading' started by Daniel.a, Oct 1, 2019.

  1. Daniel.a

    Daniel.a

    @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.
     
    #11     Oct 1, 2019
  2. fan27

    fan27

    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.
     
    #12     Oct 1, 2019
  3. Daniel.a

    Daniel.a

    @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
     
    #13     Oct 1, 2019
    tommcginnis likes this.
  4. fan27

    fan27

    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.
     
    #14     Oct 1, 2019
    tommcginnis likes this.
  5. Daniel.a

    Daniel.a

    @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
     
    #15     Oct 3, 2019
  6. 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.

    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
     
    #16     Oct 3, 2019
    djames and tommcginnis like this.
  7. Daniel.a

    Daniel.a

    @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 :)
     
    #17     Oct 4, 2019
    tommcginnis likes this.
  8. TommyR

    TommyR

    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
     
    #18     Oct 12, 2019
  9. tommcginnis

    tommcginnis

    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
     
    #19     Oct 12, 2019