Monte Carlo Simulation on Portfolio of Multiple Strategies

Discussion in 'Strategy Building' started by yoriz, Mar 16, 2024.

  1. yoriz

    yoriz

    Single Strategy Monte Carlo

    When testing a strategy, the absolute profit of a strategy does not say much. We can simply turn up the volume (aka "lot size") to generate more profit, but this obviously also increases the drawdown:
    [​IMG]
    So looking at only the profit is not enough. We should also take the drawdown into account.

    When testing a strategy you observe one particular order in which your trades made profits and losses. If the profits and losses are nicely mixed, your equity curve will follow a more or less straight line. However, even with an "edge", a large part of trading is still just probabilities. There is no guarantee that profits and losses will be consecutive. All the losses could be at the begin, or at the end. Below are three times the exact same trades but in a different order:
    [​IMG]
    You would trade the blue line, but would you trade the gray or green lines?

    It is very unlikely that future trades will be in an weird order like that, but it is also unlikely that they will be like the blue line. This is where Monte Carlo simulation comes in. It simulates thousands of randomly shuffled trades and calculates the maximum drawdown of each of the corresponding equity curves:
    [​IMG]
    We could look at the worst case scenario, but usually we ignore the top 5% extremely unlucky curves and focus on the 95%-percentile worst maximum drawdown. Based on this, we can now turn the volume knob, to tune the maximum drawdown to our risk appetite. Personally, I start to loose sleep once drawdown reaches 35% or more. After tuning the volume up or down to get desired maximum drawdown, we can calculate the corresponding profit.

    This is a nice robust way to estimate the yearly return of various strategies to compare or optimize them.

    Portfolio of Multiple Strategies

    I have been using Monte Carlo like this for years when developing strategies. However, I am unsure how to apply this for a robot that executes hundreds of strategies in parallel. These strategies have slightly different settings for take profit target, stop losses, entry timings, etc. but all follow the same logic rules. This helps to diversify the response of the strategy to changing market conditions.

    However, I feel that these strategies will occasionally suffer all at the same time when market conditions are not in favor because they implement the same logic rules. Therefore, it feels unrealistic to shuffle the total list of trades during the Monte Carlo simulation. I will have to take the "clustering" of profits and losses of the strategies into account somehow.

    I have considered ignoring the individual trade results and simply chop up the equity curve of the backtest into 1-day sections and use the profit/loss of each day to shuffle. Would that be a better approach? For scalping strategies this would not take the intra day action into account, and for strategies that keep the positions open for days or weeks this would also be odd.

    How should I approach this? Any recommendations?
     
    Last edited: Mar 16, 2024
  2. acrary

    acrary

    The easiest approach is to check the correlation of each of the strategies to one another. If a strategy is .5 or greater, keep the one with the best profit factor. Develop new strategies with a negative correlation so that you can have a smooth equity curve that we all desire.
     
    SimpleMeLike and Lou Friedman like this.
  3. It’s not Monte Carlo, it’s just re-sampling. There are standard statistical approaches to doing it right, but IMHO is mostly masturbation
     
  4. yoriz

    yoriz

    Yes, that is a good way to compile a collections of strategies into a portfolio. But how do I then measure the performance of that portfolio? Can I assume all trades are independent because I selected them for being uncorrelated? What if all the strategies have identical logic but a slightly different tuning; can we then still assume they are uncorrelated?
     
  5. yoriz

    yoriz

    In the book "Trading Systems" by Urban Jaekle and Emilio Tomasini that is what they call Monte Carlo analysis (chapter 4.2).

    What do you consider Monte Carlo?

    Can you elaborate a bit more? If you are referring to statistical approaches like Sharpe Ratio: these assume a normal distribution of the returns of each trade. For skewed, asymmetric distributions, the Sharpe is a not a good measure and the Monte Carlo approach I described gives me more representative estimates. I have seen equity curves that are clearly very bad and yet had a decent Sharpe. Monte Carlo does flag these bad curves.
     
    Slow Learning Elf likes this.
  6. I think this is bootstrapping. I think monte carlo is resampling from a distribution and there is no distributional assumption here. Both approaches have strengths and weaknesses, I usually prefer bootstrapping except with a very small dataset in which case I'd use monte carlo.

    But this is pedantic, we all know what he's doing.

    GAT
     
  7. You’re right. My main point is there is no clear benefit from doing this. You have x trading period with corresponding results - obviously not gonna learn anything alpha-related by shaking these things around (as no new information is being added) and any risk analysis benefit is questionable since you’ve lost the market context in the process of resampling. If you have cycles to burn, spend them on deeper understanding of why your alphas work and which features matter the most.
     
  8. Basic metrics like TUW, worst/n-the percentile days or quantile sharpe will inform you of these problems just as easily.

    Here is the main point (and I think I’ve clashed with @globalarbtrader on this topic in my previous reincarnation). Backtest analysis and strategy optimisation is the least important and most dangerous part of the research cycle, because you add more criteria to your back testing process and allow yourself to either tweak the strategy based on these criteria or to filter strategies in/out. It will inevitably lead to curve fitting.
     
    ButterflyEffect likes this.
  9. It depends on your utility function. Lintner and Markowitz proved that for quadratic utility, Sharpe is all you need. For other utility functions, like power (isoelastic) or exponential, not so much. For isoelastic, versions of Sharpe/Kelly accounting for higher distributional moments have been posted here on ET, by me and also in a paper posted by Euan Sinclair (specific to options trading).

    What you are doing here is neither Monte Carlo nor resampling, and certainly not a bootstrap. You're doing no resampling whatsoever -- just running multiple permutations of your trades. This is likely to be very misleading, especially if your trade series is heteroskedastic and auto-correlated (HAC). Read Efron's 70's era book "Bootstrap and Jackknife" before you proceed further.
     
    Slow Learning Elf likes this.
  10. acrary

    acrary

    When you build a portfolio like this think in terms of pairs trading. You may have a breakout strategy paired with a reversal strategy in the same time frame. A negative correlation would be confirmation of a good pairing. If you had 5 pairs each with a negative correlation then you can check the correlation between pairs and remove any pair with greater than .5 between them. If they all had low correlation between them then you could trade all 5 pairs by allocating 1/5 of your portfolio to each strategy pair.

    In the case where you're changing parameters in one strategy such as short, medium, and longer term moving averages, it's safe to say that's just one strategy and any negative correlations are likely spurious. When the chop comes they are all likely to lose on each of their timeframes.Better to look for complementary strategies that are profitable when the primary strategy isn't.
     
    #10     Mar 17, 2024