Integration with Python can be used in backtest ?

 

I've recently seen quite a few updates to Integration with Python, including various functions.

Does it can be used in back testing? 

According MQL5 Reference, I found that there is no such function.

At the same time, Socket functions can not be used from the Strategy Tester.  Is there a way to interact with python while backtesting?

MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
MQL5 Reference - How to use algorithmic/automated trading language for MetaTrader 5
  • www.mql5.com
MetaQuotes Language 5 (MQL5) is a high-level language designed for developing technical indicators, trading robots and utility applications, which automate financial trading. MQL5 has been developed by MetaQuotes Software Corp. for their trading platform. The language syntax is very close to C++ enabling programmers to develop applications in...
 
I'm facing the same issue.
 
Can you backtest a python script? Yes. Can you use the MQL Expert advisor backtester to backtest a python script? No. If you want to backtest a python script you have to use a python backtesting framework. 
 
Would be amazing if MQL created a proper framework to interact with python script from the strategy tester modul.
 
yes, shouldnt even be difficult, you literally have to pipe into the python ea not real time market but history, I honestly cant believe they are not able to do it, I guess this tool is not standing the test of time, any serious python framework to test?
 
Ulisse Tidide:
yes, shouldnt even be difficult, you literally have to pipe into the python ea not real time market but history, I honestly cant believe they are not able to do it, I guess this tool is not standing the test of time, any serious python framework to test?


Yes I would be very interested in that as well. I am currently doing some research to see if there any backtesting framework for python.


Did you guys find anything?


Perhaps it would be a good idea to build something like this.


An ideal setup would be

Python (backend) for trading  ---> MT5 (frontend) for execution

and  a backtester for the Python backend that uses the historical data and market behaviour from MT5.

That of course means one has to build/replicate the whole Strategy Tester functionality that exists in MT5 (like proper timings, slippage etc).

The advantage of course is that you can customize it. Even use a better optimisation algorithm than the generic genetic optimiser

 
nicholish en #:
Can you backtest a python script? Yes. Can you use the MQL Expert advisor backtester to backtest a python script? No. If you want to backtest a python script you have to use a python backtesting framework. 
Which python backtest framework do you recommend? 
 
Rafael Bambirra #:
Which python backtest framework do you recommend? 

You can use "Backtesting.py" module python.

 
I am not able use Socket in Strategy tester need help.
 
jothimurugan92 #: I am not able use Socket in Strategy tester need help.

You can't use MQL5 Sockets in the Strategy Tester. It is referenced in the documentation. also, you post has nothing to do with the original post or with Python. Please don't hijack threads for other topics.

 

the closest thing i've found

https://github.com/mkhushi/MQL5-Python-Backtesting

I think MetaQuotes must admit python in the strategy tester

GitHub - mkhushi/MQL5-Python-Backtesting: MQL5 based backtesting using python
GitHub - mkhushi/MQL5-Python-Backtesting: MQL5 based backtesting using python
  • mkhushi
  • github.com
How to run the Strategies: open main_decisionmaker.py and import the trading strategy which is intended to run Update the strategy and the signal line Start the backtesting in Metatrader 5 Copy the python files along with the...
Reason: