My question is, How do you connect your python scripts to MetaTrader4 and get historical data, send orders, close positions? And the second question, What does your python code do in case of internet connection lost?
MT4 does not have a Python integration like MT5. The only way to directly integrate MT4 with other system is via DLL calls (usually coded in C++), but MT4 will always act as the "server" or "master" and the DLLs will act as the "client" or "slave". DLL's are after-all just dynamic libraries!
MT4 does not have a Python integration like MT5. The only way to directly integrate MT4 with other system is via DLL calls (usually coded in C++), but MT4 will always act as the "server" or "master" and the DLLs will act as the "client" or "slave". DLL's are after-all just dynamic libraries!
it may be somehow slow but wiill do the job

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
via https://www.mql5.com/en/docs/integration/python_metatrader5 .
But, in my country, most of the Forex companies still work with MetaTrader4.
I did some research but couldn't find any python module for MetaTrader4 or any other viable way to connect my python script to MT4
My question is,
How do you connect your python scripts to MetaTrader4 and get historical data, send orders, close positions?
And the second question, What does your python code do in case of internet connection lost?
Thanks