I came across this example code (Example 2: SPY Constituents in an Uptrend) on the site and I don't understand how this very basic, but logical - - price above SMA, beats the reference ETF hands down, over longer periods. Only diverges during volatile periods, but quickly recovers after that, ultimately beating the EFT hands down.
The only changes on my part was to use 50d SMA in place of the 200d SMA and rebalance daily. All fees are included so the high turnover should not be an issue. Is there a bias leaking somewhere??? This seem too good to be true.
Mia Alissi
To address Kal's concerns about the strategy's performance and potential biases, let's break down the findings and suggestions:
Documentation Insights
ETF Constituents Universes: The ETF constituents universe allows you to select securities within an ETF, such as SPY. This can be useful for creating a universe of securities that meet specific criteria, like trading above a certain SMA.
Price Above SMA Strategy: This strategy selects securities that are trading above their SMA, indicating an uptrend. The change from a 200-day to a 50-day SMA can make the strategy more sensitive to recent price movements, potentially increasing turnover and responsiveness to market changes.
Rebalance Daily: Daily rebalancing can lead to higher transaction costs and turnover, but if fees are accounted for, it should not artificially inflate returns. However, it can make the strategy more responsive to short-term market movements.
Bias in Backtesting: Common biases include look-ahead bias, survivorship bias, and overfitting. Ensuring data quality and testing across different time periods can help mitigate these biases.
50-Day SMA vs. 200-Day SMA: The 50-day SMA is more sensitive to recent price changes, which can lead to more frequent trading signals compared to the 200-day SMA, which is smoother and less responsive to short-term fluctuations.
Suggestions for Kal
By following these steps, Kal can gain a deeper understanding of the strategy's performance and identify any potential biases or issues.
Sources: Futures Fast Trend Following, with Trend Strength, Research Guide - QuantConnect.com, Head & Shoulders TA Pattern Detection, Seasonality Effect Based On Same Calendar Month Returns, Momentum In Mutual Fund Returns
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.
Kal Seehra
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!