Automated Trading — Dollar Cost Averaging with a Twist (Python implementation)

B/O Trading Blog
6 min readAug 2, 2022

Photo by Markus Winkler on Unsplash.com

Dollar Cost Averaging (DCA) is a well-known technique for investors to take advantage of a lower average cost of an asset by performing regular investments.

DCA can also be used in combination with other trading strategies to improve the potential of making a profit if the price of an asset drops after the asset was purchased.

In this post I wanted to present a modification to the DCA that considers the minimum and maximum price during a lookback period before making a purchase.

Here is what’s in this post:

  • Review the concept of DCA
  • Discuss the pros/cons of the strategy
  • Discuss modification to the strategy: DCA with a Twist
  • Go over the Python implementation and
  • Review sample backtest results.

This story is solely for general information purposes, and should not be relied upon for trading recommendations or financial advice. Source code and information is provided for educational purposes only, and should not be relied upon to make an investment decision. Please review my full cautionary guidance before continuing.

--

--

B/O Trading Blog

Blogging about algorithmic trading, Python utilities and passive income opportunities.