This application was created to share and backtest a recurring stock purchasing algorithm . The goal of the algorithm is to be an alternative to a constant recurring investment that provides better dollar cost averging (lower cost per stock purchased). This is not financial advice!
The backtesting of the algorithm assumes only stock purchases are made; no selling occurs. In addition, the principal invested is not fixed. Instead, a constant user defined max and min are set for the recurring stock purchases.
This page introduces the algorithm. The Try Now page allows users to backtest the algorithm using their own inputs and selected stock. Users can save their investment inputs using the Sign Up page to created a site account.
To understand this buying algorithm, users are first introduced to a stock's 52 week high drop. This percentage is computed with the following steps:
The plot the right illustrates current and max price over the last year for the stock ticker SPY. The live 52 week high drop is computed.
After picking a stock and recurring investment frequency, the amount spent must be determined for each purchase.
First the user must select select three parameters:
With these three parameters the plot to the left is produced. This graph shows the percent spend relative to the max. amount as a function of the 52 week high drop in the horizontal axis.
Therefore, at each purchase time this graph is used to determine purchase amount based on the 52 week high drop.
The chosen 52 week high drop to spend half of the set max is an important percentage to pick. At zero percent the algorithm will make a constant recurring max purchase. If the value of this drop is increased smaller purchases will be made during bullish periods relative to bearish periods.
The previous caveat is the reason why one would pick a low half spend drop for stocks you want to consistently invest in, even when prices are high. A high half spend drop would be appropriate for a stock you only want to purchase during low prices.
Many stock exchanges do not allow minimum purchases below one dollar. The same is true in this algorithm; note a min spend of zero means some recurring purchases may not occur. If this is non-zero the algorithm will make a constant min spend purchase when the year high drop is less than a certain percentage.