15 Comments

Hi!

Would be great to see how your strategies would do if executed on close vs open (what you seem to do systematically). I think a lot of the edge would go away but there would also be less slippage.

I would love to see this as future post!

Keep up the good work

Expand full comment

Nice write up,

I am trying to replicate but one thing I am not sure about is how you go about labeling the data using future returns. rank:pairwise requires 0 or positive integers so using raw future returns wouldn't work. What method would you suggest labeling the data here?

Expand full comment

[edited]

Expand full comment

ok so you directly rank the group of returns. I was thinking of either that or explicitly adding a buffer to ensure the lowest return is > 0...

Thanks!

Expand full comment
Comment deleted
Mar 21Edited
Comment deleted
Expand full comment

The whole point, at least to me, was to implement the paper as closely as possible to what the authors described. In that sense, if you read XGBoost documentation (https://xgboost.readthedocs.io/en/stable/tutorials/learning_to_rank.html), the choices are clear. XGBoost documentation has done a great job explaining how to implement LTR. I just followed their lead. Their LTR tutorial doesn't even mention XGBRanker

Expand full comment

Thanks for the post! Will we ever get access to the code? Plus what kind of momentum and volatility signals are you using? Any elaboration would be appreciated

Expand full comment

Thanks! Yes, I am preparing the course, as I mentioned in the article, to share this codebase together with a few more strategies, backtester, and implementation code.

It's just taking a bit longer than expected because of the high workload these past few weeks

Expand full comment

Hey Carlos, very cool right up, I've worked a fair amount on market neutral strategies myself (and also have a first loss setup running for about a year now). Wanted to know if you'd had a look at some of Zura Kakushadze's work (Mean-Reversion and Optimization, Heterotic Risk Models, Multifactor Risk Models and Heterotic CAPM, etc)? Reading this article, I immediately thought of some of his papers. I'd love to see you unpack some of the ideas in his papers if you think it'd be a good fit :)

Also, care to share which first loss allocators you've chatted with? I can give a few recs as well if you'd like.

Best,

Richard

Expand full comment

Hi Richard! Thanks! I haven't read Zura Kakushadze's work yet, but I will look into it. Re first loss, I will send you an emai.. Cheers!

Expand full comment

Great post, thanks for sharing!

Expand full comment

Your posts are infinity source of ideas and inspiration. Thanks a lot! Waiting for the course.

Few questions:

1. I think comparing leverage strategy vs unleveraged SP500 is not fair. Looks like unleveraged strategy with 30 quantile is ~900%, which is still amazing comparing to ~400% of SP500. Am I right?

2. One thing that is stopping me personally to try this strategy is 200 securities. What do you think should be a minimum size of one security in the strategy? With $100.000 you are starting, initially you would be able to allocate only $500 per security. With leverage 1.5x - $750. Do you think it would be enough giving fees?

3. I am not sure how to properly include leverage fee into final calculations. IBKR PRO fee is about 5.83% yearly. Did add it into BPS fees somehow?

Expand full comment

Thanks, Eugene! To the questions:

1. The point of showing a benchmark is just to have a comparison... imho, the best benchmark should be an index tracking market-neutral hedge funds, such as HFRX. If we want to be rigorous, the whole comparison of this strategy with S&P 500 is not fair, not only because of leverage, but also (and maybe most importantly) because of the market neutrality! Comparing a market-neutral strategy with a long-only strategy is not apples to apples... I use S&P 500 because it's free, and to simplify.

2. That's a great question. In my back-of-napkin math, I wouldn't trade this with less than a couple of million usd.

3. Another great point. Someone asked the same question on Twitter. Imho, this is one of the main reasons why we must forward-test before putting strategies into live mode. After a few 3-6 months of forward test, we could not only get the cost of shorting right, but also short availability. Imho, it's counter-productive to try to include everything in backtests - it makes them too complex to run. The purpose of backtests should be to discard bad ideas (fast). If an idea is not discarded, then it moves to the next phase: forward testing. In this phase, we can collect more details about the execution, such as borrowing fees.

Cheers!

Expand full comment

Thanks for sharing! Are there any OOS testing on this? training/validation/test split?

The paper was published in 2020, it would be great if leave the last 4-5 years as OOS data and test the 2020 model on it.

Expand full comment

Hi,

All results are OOS. As I explained, the model is retrained annually using past 15 years of data. So, for example:

- 2006 results: obtained by model trained using 1990-2005 data

- 2007 results: obtained by model trained using 1991-2006 data

So on and so forth. This is how train/test splits are generated. This sliding window technique is pretty common in time series modeling.

Also, I didn’t use validation sets as I didn’t do any hyper parameter tuning. The parameters were fixed in all experiments.

Cheers!

Expand full comment

thanks for the post! I saw this paper sometime ago and was impressed/surprised by the performance. Could you please elaborate on the features and model parameters (xgb.XGBRanker?)? I tried to reproduce the strategy with monthly recalibration myself and only got a sharpe around 0.6. Thanks!

Expand full comment