Simple coding guide to

Build a trading simulator in Python

…and get investment suggestions from it

Markus Rene Pae
The Startup
Published in
9 min readJan 4, 2020

--

We live in crazy times, right? A regular farmer can go online and buy stocks via his/her e-banking. Furthermore, anyone could start learning to program and build a script that gives recommendations on what stocks and how much should he buy.

I’m not a farmer but basically, most of my coding knowledge comes from the Internet and I have built myself such a platform (it’s more like a simulator, really) that evaluates different trading strategies and estimates the amount of profit it can make. I’ve been testing different strategies and one approach led me to a quite intriguing result: over the past two decades, this approach made a 9438% profit.

How confident am I in this result?

The short answer is — a lot. You probably think that either this is impossible to repeat or this must have some sort of a flaw in logic. Although if 20 years ago (I was only 2) I had the same skills, knowledge, and access to trading that I have now, I would’ve given this strategy a shot.

Secondly, I achieved this result from a simulator I created myself. In reality, we must reduce the profit by the amount of money that went into paying commission fees.

--

--

Markus Rene Pae
The Startup

Technician @University of Tartu | coding, investing, mathematics, data science enthusiast | Medium writer since December 2019 | lifelong learner