Here's an algo that buys the biggest loser with a slowing descent. I've used my Universe Template.
There's no slippage modelling but the algo only considers the 10 most liquid stocks and is of Daily resolution so slippage shoudn't completely destroy the alpha.
Market dynamics over the last five years seem favorable to this approach.
Michael Manus
Thank you for that algo. very interesting.
some thoughts:
someone on quantopian writes the following:
""This is my first time interacting with algo-trading so my first thought was to try something I thought other people would ignore, instead of using the top/bottom 10% of stocks I made that very small and it returned 20%. The smaller I made the value, the higher the return would get.""
taking maybe 5 different (higher/lower) stocks would give better results.
Petter Hansson
This is pretty neat. Still waiting for backtest to finish but I think you're onto something good here. I will report back later.
Michael Manus
ok bad comment above.....i mean not taking always the top/lowest 10....
Petter Hansson
Some initial comments, I realize most things I mention are due to this algo being a protype:
- I couldn't see reasons for the last peak as I got out of memory on backtest, but beware there are exotic ETFs being traded by the algo right now (e.g. saw it trading VXX). One might wish to disallow it from trading these instruments that have special considerations.
- Slippage is indeed evil and even daily can ruin some good alpha. Would be worthwhile looking into how large it is on average here, even though for some ETFs it's almost completely neglible for daily bars (e.g. SPY, IWM).
- As far as I've read elsewhere, we're currently in a mode of market where a few big companies are driving it by outperforming the wider index. This might be contributing to the alpha? Saw the algo trading a lot of FANGs for instance.
- While beta isn't super high I'm still afraid of what happens on bad days. :-) 2015 stands out in the test period, but there will probably be worse due to correlations during tail events. However, I guess it's an acceptable risk compared to say being 100% long XIV, haha.
Warren Harding
Another thing that should be mentioned is that there is no position building code, it just buys/sells with a single order in a simplistic fashion. For large accounts you would definitely want to spread the buys/sells out over time to avoid excessive slippage. As Petter mentioned it should be treated as a prototype, I'ld go over it carefully before trading it live.
Anthony B
Beautiful...
Vidal boreal
I just cloned and re-run it but similar result could not be reproduced. Lower sharpe and return. What is the reason?
Daniel Chen
Hi KY,
Thank you for your question. The original algorithm in this post was done about 2 years ago. From then on, we fixed some data issues, so the data now is not exactly the same as the data two years ago, which leads to the difference.
We recommend you run this algorithm in the current LEAN engine with the most updated data. Thank you!Â
Warren Harding
Interesting. I posted this in 2017 and forgot about it. I just cloned and ran it. It did quite well over the last two years out of sample.
SherpaTrader
Does this need to have some setwarmup done, before it can be run for live. since it uses 3 days of historical data, ?
Derek Melchin
Hi SherpaTrader,
This algorithm calls the History method inside OnData. This is not a practice we recommend as it slows down the execution speed. In regards to the question above, adding SetWarmup would not benefit this implementation since the History call is made during every OnData iteration. Instead, I'd recommend replacing the History call with some consolidators to automatically update the StockData properties.
Best,
Derek Melchin
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Warren Harding
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!