Sector ETF EMA Crossover Portfolio and Broker API Implementation
Summary
The project builds a long-only daily strategy across nine SPDR sector ETFs using short- and long-term exponential moving average crossovers. It reallocates capital quarterly based on each ETF’s relative quarterly return, aiming to direct more capital toward stronger sectors. The author backtests daily data from 2012 through 2021, compares the portfolio with SPY, and reports annualized return, Sharpe ratio, and maximum drawdown figures. Results are historical backtest findings; the author describes the rule set as simple and says its parameters could be improved.
The second part translates the daily routine to Interactive Brokers through a REST API, with Python functions organized in a Jupyter Notebook. The report discusses the choice among broker connection methods and the practical work of building, troubleshooting, and running the workflow on a paper-trading account. Its live system had not been tested for an extended period, quarterly rebalancing was still to be completed in the implementation, and risk-management blocks were absent. These gaps limit conclusions about live execution and whether backtest behavior would persist.
Key ideas
- The strategy trades nine sector ETFs long-only using short- and long-term EMA crossover signals.
- Capital is allocated quarterly according to the ETFs’ relative quarterly returns.
- The reported backtest uses daily data and compares results with SPY, but does not establish future or live performance.
- The project implements broker connectivity and daily trading routines through an Interactive Brokers REST API and Jupyter Notebook.
- The live implementation lacked extended testing, completed quarterly rebalancing, and built-in risk management.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.