Designing a Profitable Intraday Strategy Using Python and Alpaca
We've just released a new article that provides the Python code used to backtest a profitable intraday model on SPY. From 2018, the model yielded a return of over 30% per year with a Sharpe Ratio of 1.95.
The strategy not only leverages the trading edge outlined in our paper Beat the Market, but also capitalizes on overnight gaps that typically revert within the first 30 minutes of the trading session.
For this backtest, we used Alpaca as data provider as it offers 7 years of free intraday data for many US stocks and ETFs, a significant improvement over Polygon, which offers only 2 years of free data.
A step-by-step guide is presented below!
We've just released a new article that provides the Python code used to backtest a profitable intraday model on SPY. From 2018, the model yielded a return of over 30% per year with a Sharpe Ratio of 1.95.
The strategy not only leverages the trading edge outlined in our paper Beat the Market, but also capitalizes on overnight gaps that typically revert within the first 30 minutes of the trading session.
For this backtest, we used Alpaca as data provider as it offers 7 years of free intraday data for many US stocks and ETFs, a significant improvement over Polygon, which offers only 2 years of free data.
A step-by-step guide is presented below!
Step 1. Open Google Colab Link
β Visit ConcretumGroup website and open this article bit.ly
β Click on the Google Colab link
β Visit ConcretumGroup website and open this article bit.ly
β Click on the Google Colab link
Step 2. Obtain a FREE API Key from Alpaca
β Sign up for a FREE account on alpaca.markets
β Copy and paste your API Key into Google Colab
β Sign up for a FREE account on alpaca.markets
β Copy and paste your API Key into Google Colab
Step 5. Customize and Explore Further
β Easily modify backtest parameters such as Volatility Multiplier, commission per share, starting equity, or rebalancing frequency.
β Change the overnight_threshold parameter
β Apply the same strategy to other US ETFs or stocks.
β Share your backtest results with the Fintwit community!
β Easily modify backtest parameters such as Volatility Multiplier, commission per share, starting equity, or rebalancing frequency.
β Change the overnight_threshold parameter
β Apply the same strategy to other US ETFs or stocks.
β Share your backtest results with the Fintwit community!
For more details on how the strategy is constructed, we highly recommend reading the original paper for FREE bit.ly
If you use @TradingView you can add on your charts the Concretum Bands as presented in the paper. Find more info here bit.ly
If you use @TradingView you can add on your charts the Concretum Bands as presented in the paper. Find more info here bit.ly
Loading suggestions...