Discussion of article "MetaTrader 5 and Python integration: receiving and sending data"
Thank you. Too bad, without casting.
As I will do - I'll upload an example here for sure, it's just that I didn't have such a task before.
Also, if sockets will get their development in the tester, then it will be very relevant.
For history, there is a large standard maths library in MQL5 in the sources right in the terminal:
- Statistical distributions in MQL5 - taking the best from R and making it faster
Let's consider functions for working with basic statistical distributions implemented in the R language.
These are Cauchy, Weibull, normal, lognormal, logistic, exponential, uniform, gamma distribution, central and non-central Beta distributions, chi-square, Fisher's F-distributions, Student's t-distributions, as well as discrete binomial and negative binomial distributions, geometric, hypergeometric and Poisson distributions. In addition, there are functions for calculating theoretical moments of distributions, which allow us to assess the degree to which the real distribution matches the model distribution.
We have included a large number of mathematical functions from R into the standard MQL5 library. Moreover, we have achieved their faster operation from 3 to 7 times compared to the original versions in the R language. - MQL5 Reference Guide / Standard Library / Mathematics / Statistics
These are several hundred functions in the sections: Statistical Characteristics, Normal Distribution, Lognormal Distribution, Beta Distribution, Non-central Beta Distribution, Gamma Distribution, Chi-Square Distribution, Non-central Chi-Square Distribution, Exponential Distribution, F-Distribution, Non-central F-Distribution, T-Distribution, Non-central T-distribution, Logistic distribution, Cauchy distribution, Uniform distribution, Weibull distribution, Binomial distribution, Negative binomial distribution, Geometric distribution, Hypergeometric distribution, Poisson distribution, Auxiliary functions
I always read @Maxim Dmitrievsky 's articles with pleasure, I like his approach to writing articles - the implementation of the idea itself is described concisely, I don't like lately "kilometre-long spools" of code and chewing up every line to "and now we'll name the variable XY, where we'll store ...".
Thanks!
With pleasure I always read articles by @Maxim Dmitrievsky, I like his approach to writing articles - the implementation of the idea is described concisely, I don't like lately "kilometre long stretches" of code and chewing up each line to "and now we will name the variable XY, where we will store ...".
Thank you!
So there are different kinds of readers, both experienced and novice.
Well, as if you are right, and not very - human attention is a very limited resource, and even an experienced reader to get into the essence of the article has to read "diagonally" otherwise by the end of the article simply will not digest the material.
If I'm not mistaken, a person can digest new material only for the first 15 minutes, then attention decreases and the effect of new knowledge will be null - as they say "less is better".
It is possible, of course, to stretch reading a large article, like reading a magazine or a book for several days, but this is not my option
socketclientEA (Si-6.19,M15) Connection localhost:9090 error 4014
https://www.mql5.com/en/docs/network/socketconnect
When called from the indicator,GetLastError() will return error 4014 - "System function not allowed to be called".
Solution:
The address for connection should be added to the list of allowed addresses on the client terminal side (section Tools \ Settings \ Expert Advisors).
Allow Webrequest for the following url:
http://localhost
New article MetaTrader 5 and Python integration: receiving and sending data has been published:
Author: Maxim Dmitrievsky
Thank you finally.. :)
Please post more.. Lots More.. I love it..- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article MetaTrader 5 and Python integration: receiving and sending data has been published:
Comprehensive data processing requires extensive tools and is often beyond the sandbox of one single application. Specialized programming languages are used for processing and analyzing data, statistics and machine learning. One of the leading programming languages for data processing is Python. The article provides a description of how to connect MetaTrader 5 and Python using sockets, as well as how to receive quotes via the terminal API.
We will write a simple program which will create a socket server and receive the necessary information from the client (the MQL5 program), handle it and send back the result. This seems to be the most efficient interaction method. Suppose we need to use a machine learning library, such as for example scikit learn, which will calculate linear regression using prices and return coordinates, based on which a line can be drawn in the MetaTrader 5 terminal. This is the basic example. However, such interaction can also be used for training a neural network, for sending to it data from the terminal (quotes), learning and returning the result to the terminal.
Now we can proceed to creating a class responsible for socket manipulation:
We can see a good correlation between GBPUSD and GBPJPY in the above heat map.
Author: Maxim Dmitrievsky