@Joakim, here is a technique I use in my own strategies. Call it CAGR decay compensation. It is given as a suggestion or a slightly different way of looking at the problem but can still have quite an impact.
Using the numbers extracted from your
round_trips = True
option in your first notebook I made the following chart based on the number of trades, average net profit per trade, … . On the 7th year we have comparable numbers as in your simulation. Then, I extrapolated what would come next and generated the following chart:
We can observe that your CAGR (original CAGR on the chart) is decaying with time. It will probably be more severe going forward since I usually run on the optimistic side. Nonetheless, by the very architecture of your trading script, this CAGR will continue to decay.
An alternative would be to structurally compensate for this decay. The above chart also displays a simple extrapolation of a probable and foreseeable future for some decay compensation.
The top line says that you could compensate to a level such that your CAGR would increase with time. This compensation could be modulated, increased or decreased depending on your other portfolio constraints (mostly by relaxing some of those constraints). But, it would still remain a choice to be made and would require some reengineering to your trading strategy to make it happen.
For instance, a slight nudge on the number of trades to the upside would be sufficient to make the compensated CAGR a flat line, thereby maintaining a constant CAGR over the portfolio's extended life. Slightly over-compensating (depending on point of view) could result in the above chart with its expanding CAGR with time. Should you want it higher, you slightly over-compensate some more.
The advantage of compensating for the expected CAGR decay should be evident from the above chart. Compensating would give your trading script, on average, over a longer-term, year over year, a higher portfolio CAGR level. Thereby defying the Law of diminishing returns from within your trading script.
I covered this in more detail in some of my old articles of which I retained the following which I think was also presented in one of the forums around Sept. 2016: https://alphapowertrading.com/images/divers/Strategy_Enhancers.html