Creating a Moving Average Cross Trading Strategy Step-by-step.

Coding and Back-testing a Moving Average Strategy From Scratch in Python.

Sofien Kaabar, CFA
Geek Culture
Published in
14 min readApr 11, 2021

--

www.pxfuel.com

The most basic Trend-Following strategy is the cross between different-period moving averages as it can signal a potential change in the overall trend. Intuitively, it is a good strategy but we always need to back oir intuitions with numbers. The idea of the article is to create back-test from scratch at its basic form to have a preliminary idea on the results. Therefore, importing data and analyzing the results (with the code) are covered.

I have just published a new book after the success of New Technical Indicators in Python. It features a more complete description and addition of complex trading strategies with a Github page dedicated to the continuously updated code. If you feel that this interests you, feel free to visit the below link, or if you prefer to buy the PDF version, you could contact me on Linkedin.

Importing Historical Data

--

--