MT5 Python Indicator Exporter Free
- Utilidades
- Joao Paulo Euko
- Versión: 1.20
- Actualizado: 11 noviembre 2020
Hi you, I need your help! Be my Patron, let's make it possible!
https://www.patreon.com/joaopeuko
https://github.com/Joaopeuko/Mql5-Python-Integration
Channel:
English version - Versão Inglês:
https://www.mql5.com/en/channels/Mql5_Python_Integration_EN
Portuguese version - Versão Português:
https://www.mql5.com/en/channels/Mql5_Python_Integration_PT
Paid version with 38 indicator:
https://www.mql5.com/en/market/product/58056
I believe that development in PYTHON is easier and simpler to make an Expert Advisor or any other tool that helps you to make a decision when related to the stock market.
So, I built a library in Python that makes it easy and simple to make expert advisors. It is possible to find it here:
https://github.com/Joaopeuko/Mql5-Python-Integration
This MQL5 Service uses Socket communication to send and receive data.
This MQL5 Service is the “Client-Side”, so it will only work if there is a server-side sending data to it, asking for some Indicator.
An example of Expert Advisor using sockets can be found here:
However, there are some difficulties when using python to code an expert advisor, one of these difficulties is the Indicator usage, most of it does not exist yet.
To solve that problem you can:
-
You can recreate all the indicators.
-
You can use a library that has some or all the indicators.
-
You can communicate through the Metatrader5 asking for the indicator data.
This MQL5 Service uses the indicators that are already built on Metatrader5, it just asks for the data, informing the setup first, and the service responds to it.
This service only works with a few indicators:
-
Bollinger Bands
-
MACD
-
Moving Average
-
OBV On Balance Volume
-
Stochastic
I built the communication using the same pattern used on MetaTrader5:
https://www.mql5.com/en/docs/indicators
The address and the port must be the same on the MQL5 Service and in the python code.
To use a service you just need to go in service, and a new one, it is near the expert advisor folder, at the button, on MetaTrader 5.
Image 1
You can use as many services you want until you reach the “Activation” limits.
Image 2
When using more than one service they might conflict, changing the port is a solution.
To be able to send data out of MetaTrader5 you first need to allow it, the “localhost” needs to be added.
-
Tools -> Options -> Expert advisors -> WbRequest (checkbox)
Image 3
It is good to know that I built that Service to work only in the “localhost.”
If you are in doubt, it uses sockets to work.
It is possible to call the same indicator with a different setup of how many times you want. However, when using too many indicators it might reduce performance.
You can see the expert advisor using indicator here:
All the indicators are defined to work with a time frame of one minute, to change it you just need to change the “time_frame.”
All the indicators have comments to make it easy to understand and know how to use it.
https://github.com/Joaopeuko/Mql5-Python-Integration/blob/master/Include/indicator_connector.py
Image 4
If you are having any trouble, please send me a direct message, I will be pleased to help you.
I've developed the same project based on sockets, but sockets have a limit on how much data they transmit, and it loses data every time I request a large amount of data.Have you ever had the same problem?
I tested your program and you are getting individual indicator data every time. Have you ever tested to obtain batch indicator data? For example, I want to get all the indicator data of the EURUSD 1 minute time frame within 1 year at one time.
I have tried to return a huge batch of data of EURUSD, but when the size is big (300000) the indicator starts to crash. Also, a request of one million minutes returns the maximum amount for EURUSD an array of 419431 minutes. For now, I was not able to find a solution, not yet.