Optimized Momentum Trading

Returns: 29,923.07%
Drawdown: -39.77%
Benchmark (S&P 500): 288.21%

Sep 1, 2002 - Oct 5, 2020

An algorithm optimized for long-only, non-leveraged trading with backtested percentage performance similar to Apple from Sep 1, 2002 - Oct 5, 2020, using real-time market data from the Morningstar universe.

Using fundamental factors and momentum strategies the algorithm ranks all stocks in the dataset and chooses the top five to trade weekly, outperforming most long term held stocks in the NYSE within the time frame at a percentage gain of 29,923.07%.

Slope, beta and linear regression methods1 were chosen to measure technical signals, responsively attending to short term price velocities over moving average applications (more often used for time series modeling).

+

01

1.

02

2.

1. Linear regression: (Y ∼ α + βX)
Y is distributed as alpha plus beta X

2. SimpleBeta(): The slope of the regression line between an asset's returns and another asset's returns

The algorithm starts by measuring weekly S&P 500 beta with all existing assets2 within the Quantopian dataset and simultaneously ranks defined fundamental factors of all stocks in the Morningstar universe, then associates the top fundamentally-based selection or the alpha of the selection with the given beta conditions, which are then traded in the current week. Using linear regression data with the selected securities previous five days closing prices optimized price performance, indicating that price momentum in the week prior continues to the currently traded week.
fundamental_factor = ms.fundamental_factor.latest > 0.5
spy_beta = SB(target=context.SPY, regression_length=context.bars_5)
Partial code sample

It was found that certain groups of stocks performed optimally with certain conditions - a 'growth'-focused selection performed best under positive S&P 500 beta conditions; a 'value' selection performed best under negative S&P 500 beta conditions. Growth and value lists can both be best defined as stable companies where growth focuses more on fundamental value percentage growth.

Tuesday trade execution provided the greatest returns.

Under monthly negative price action or weekly sharp drops, bonds are purchased instead of stocks to stabilize the portfolio. In the instance of the market crash of 2008-09, long term damage was prevented by increasing the initial value of growth.

During the time period, only Netflix (NFLX) and Monster (MNST) outperformed the algorithm.

Notes:
1. Linear regression, SimpleBeta Building a Better Beta
2. SimpleBeta Github
3. Quantopian Pipeline and rankings Introducing the Quantopian Pipeline API
4. Slippage and commission were set to zero so that stats of the algorithm's core focus on fundamentals and technical performance could be measured.
5. S&P 500 beta is measured weekly.
6. MaximizeAlpha is a proprietary function to Quantopian, described as an optimization that correlates a combined factor ranking to expected returns, emphasizing those securities with the highest expected return. Github


Statements on this website are for informational purposes only and do not constitute a recommendation or advice by the website owner to transact any security or market instrument. All trading activity involves known and unknown risk. Historical data presented is not always indicative of future performance.

Social

X
Github

Contact

Email