I am using some leveraged ETFs for backtesting but they are fairly recent creations. I would love to include tests like the tech bubble and the great recession. It seems fairly straightforward to simulate the data of SPXL by simply following the performance of something like SPY. I imagine there are 2 approaches:
- Precompute. Create my own custom data files which import minute data from SPY, but modified to simulate the daily leveraged results. But where can I get this data?
- Compute at runtime. Somehow create a ‘dynamic’ equity, which would take in the minute data from SPY and do the calculations on the fly.
Has anyone tried this, or is there a different way I'm not aware of?
Derrick Tan
Bump. Any suggestions?
Fred Painchaud
Hi Derrick,
Your option 2 looks good to me. You can find data for option 1 but the quality might be questionable and for leveraged ETFs sim, discrepancies would be multiplied up or down. So using minute data from SPY and then in OnData, create new TradeBars from SPY TradeBars that you then feed into your algo seems relatively simple.
Now, you will need to rebalance everyday of course just like leveraged ETFs…
Fred
Derrick Tan
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!