The processes of running live and backtesting are mostly in place already. I have some small modifications and then I add a new strategy very quickly to show how it can be done.
In this code I use pandas_ta as a technical analysis library. As of the time fo writing this there is an incompatibility between the released version of pandas_ta and versions of numpy from 2.0.0 onwards. To work around the problem I forked the repository and made a quick one line change to pandas_ta. This is a quick hack and in no way associated with the ongoing development of pandas_ta but you are welcome to use my custom version if it helps.
I did not change the version numbers from the release version so if you already have pandas_ta installed I recommend uninstalling first.
To install my custom version
pip uninstall pandas_ta pip install -U git+https://github.com/OrchardForexTutorials/pandas-ta.git --no-cache-dir
You can download the code from this tutorial here
The platform, everything except the strategy file, is available on github at https://github.com/OrchardForexTutorials/trading_bot
Looking for a broker? Support the channel by using one of these links. We receive a commission on your trades from the broker at no cost to you:
For Australian customers without trading restrictions – Black Bull
Outside Australia – FXTrading