Backtesting suite in Python

 

Hi everyone,


ok so from what i have been reading, it is not possible to use the python module and test a Python based algorithm through Strategy Tester.

Which, unless I am mistaken, leaves the only option of building some backtesting suite outside of MT5 that can be tested with Python (or some other language) and optimized with an optimizer of our choosing (instead of the genetic algorithm).


So I was wondering, if you know of anyone in here who has developed such a backtesting suite that can replicate the backtesting accuracy and behaviour of strategy tester.

It would be really helpful for me (and I am sure for other people) that wish to build their EAs in Python.


Thank you all


(I just realised I posted this in the wrong forum subject area. Sorry)

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.
 
Hi,
I would also like to do backtest with robots developed in python and integrated with mql5.
 
Janet Sheao Mae Wen: ok so from what i have been reading, it is not possible to use the python module and test a Python based algorithm through Strategy Tester. Which, unless I am mistaken, leaves the only option of building some backtesting suite outside of MT5 that can be tested with Python (or some other language) and optimized with an optimizer of our choosing (instead of the genetic algorithm). So I was wondering, if you know of anyone in here who has developed such a backtesting suite that can replicate the backtesting accuracy and behaviour of strategy tester. It would be really helpful for me (and I am sure for other people) that wish to build their EAs in Python.

I doubt you will find it. For one there is no "virtual" simulation of the order processing in the API. The entire workings of MetaTrader's trading system would have to be build in Python in order to simulate everything in that context. Also, given that Python is much slower than compiled MQL5, testing and optimisation would be really slow, nor would you be able to use MQL5 cloud for it.

It will just be much easier and better to just port things into MQL5 instead of using Python for trading robots.