Tutorial: How to Backtest a Bitcoin Trading Strategy in Python

This is a tutorial for backtesting a trading strategy in Python with backtrader framework. Access to the code: …


  1. Hi, I watched your video and as always, a great tutorial, but would you mind sharing with us how we can modify your Python code here in order to backtest trading strategies designed for currency pairs on MT4 using ZMQ module? I mean, suppose I have a trading strategy in a Python file which combined with your PythonicMT4.py in previous videos placing trades on MT4 through ZMQ, how should I use your backtest.py here to grab data from MT4 and to backtest my strategy? Should I download historical data from MT4 then designate the datapath in the Python file? Is it possible for me to download historical RSI values from MT4? I see in the trade logic part, you specified how you open Buy and Sell orders, but how do you define the conditions when these orders should be closed? It must be a piece of cake for you, I would appreciate if you could tell me how I can do it. Thanks!

Leave a Reply

Your email address will not be published.


3 + = 10