17 Comments
User's avatar
patcap's avatar

Thanks again for these ideas.

I tested this OLMAR strategy with a equal weighted top 20 crypto market cap using historical constituents - (I found the actual top 20 crypto coins on day x and used that as the composition in the strategy). Showed pretty great results, but I don't typically test crypto so i'm a bit skeptical about the data quality and transaction costs. Also drops very sharply on transaction costs.

Can't share the image here, so made a note of it https://substack.com/profile/98614510-patcap/note/c-118873496

Expand full comment
patcap's avatar

Realistically though, that CAGR is overstated - i cant imagine you get < 50 bps in crypto which makes this strategy closer to 34%

=== Strategy Summary ===

TotalReturn: 91619.02%

CAGR: 89.55%

AnnualVol: 46.32%

Sharpe: 1.93

MaxDrawdown: -24.41%

=== Benchmark Summary ===

TotalReturn: 521.54%

CAGR: 18.68%

AnnualVol: 26.56%

Sharpe: 0.70

MaxDrawdown: -50.59%

Expand full comment
Quantish's avatar

THIS. What a gem.

Cant wait to do some tinkering with this in QC.

Thanks @papertoprofit for sharing!

Expand full comment
Stuart Farmer's avatar

Thanks my man!

Expand full comment
Jason's avatar

I think your calculation is not correct. Please double check your code. either you did not normalize the weight or you used tomorrow data.

Expand full comment
Stuart Farmer's avatar

There is no lookahead bias in this code. See here: https://github.com/StuartFarmer/portwine/blob/main/tests/test_backtester.py#L198

Furthermore, you can run the code from the notebook yourself and make sure that all weights summed are adding up to 1 and therefore normalized.

After getting the `results` object from the `run_backtest` function, compute `results['signals_df'].sum(axis=1).max()` and you'll see that it is equal, or nearly equal (1.000002 due to floating point rounding), to 1.

Expand full comment
Jason's avatar

I coded same strategy myself on qqq100 or spy500 components. The result indicated that using olmar boosted cumulative return about 200-300%. The cumulative return in the power of 30 is too ridiculous. I do not know python so I do not know if any error in your code.

Expand full comment
Stuart Farmer's avatar

If you read the original paper, you will see similar numbers to my results. Also, what is your timeframe? 200-300% over 24 years is far worse than equal weighted buy and hold.

Expand full comment
Jason's avatar

If you know Java, I can upload my Java code so that you can see why my calculate only shows 2-4 times of advantage over buy and hold

Expand full comment
Jason's avatar

My calculation of 200-300% return is a relative return against QQQ or SPY return in 10 years from 2016-2025. For example, if QQQ return is 400%, 200% return is 800% absolute value. For return goes up to 10 power of 30 in 24 years, that is equivalent to 1.1% return every day compounded in 24 years, which is impossible.

Expand full comment
Stuart Farmer's avatar

Again, feel free to look at the code. I provided you with the evidence that there is no lookahead or leverage so feel free to look at the code and find the problem. The only lookahead is using the SP600 of today which includes the best performers of yesterday.

Expand full comment
Jason's avatar

I will. Do you have simper version so that I can ask Chatgtp to convert to Java so that I can understand? The file you provided is too long for Chatgtp to work. In the case that 10 power of 30 right, anyone can invest 100 dollars to make billions. Even if the 100 is wiped out, one can restart 1000 times to make it work. Since no one has done it, it means the return could not be that high.

Expand full comment
Stuart Farmer's avatar

I do not. The implementation is faithful to the paper. There is a MATLAB version online as well written by the authors that you can reference.

Furthermore, no. There is simply not enough liquidity in the market to support making this much money. After you start to amass large amount of capital, you will not be able to deploy it without causing slippage in the assets you’re trading.

This backtest must make certain assumptions because we are not modeling level 2 or fills like that.

Expand full comment
Anonymous123421's avatar

Hey man love your work! Already subscribed but where to get the code? I can't access google drive I think

Expand full comment
Stuart Farmer's avatar

DM'd!

Expand full comment