You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
WebRequest does not work in indicators (and this library allows you to bypass this limitation). A separate thread in MT is allocated only to experts and scripts, but scripts do not work with events.
I see. Thanks. I didn't know.
In MT4 1146 the resources are fully functional. The idea can be safely ported to the fourth version.
Yes, that's the idea. But it will work only in MT5.
I have implemented this idea (with chart objects).
use iCustom-indicator as a manager, and it will launch WebRequest in its script for each WebRequestAsync.
The design should be simpler and more reliable, because there will be no additional windows.
The result is as follows.
The scripts don't work because I can't pass a parameter to them at startup - it seems that scripts are not friendly with chart templates at all. The fact that they manage to run them at all with the help of Expert.mqh library (though without parameters), by analogy with Expert Advisors - it seems to be a happy accident.
If you execute web-requests not in scripts but in Expert Advisors, the scheme works halfway. That is, the input parameters work normally and we manage to pass the name of the resource with data to the Expert Advisor. But for some reason, only the OnInit event is triggered in the Expert Advisors launched in chart objects, while, for example, OnTick or OnTimer are not. It is not very nice to execute a web-request in OnInit, but it is possible. However, all this logic slows down terribly, because opening a chart object for each request causes a lot of overhead.
Implemented this idea (with chart objects).
The result is as follows.
The scripts don't work because I can't pass a parameter to them when launching them - it seems that scripts are not friendly with chart templates at all. The fact that they can be launched using the Expert.mqh library at all (though without parameters), by analogy with Expert Advisors - it seems to be a happy accident.
I had to study the topic. The scripts are run by the template and on a regular chart, but without the ability to set input parameters. So the PlaySound method will definitely work.
If we execute web queries not in scripts but in Expert Advisors, the scheme works halfway. That is, the input parameters work normally and we manage to pass the name of the resource with data to the Expert Advisor. But for some reason, only the OnInit event is triggered in the Expert Advisors launched in chart objects, while, for example, OnTick or OnTimer are not. It is not very nice to execute a web-request in OnInit, but it is possible. However, all this logic slows down terribly, because opening a chart object for each request gives you a lot of overhead.
Nothing works for me.
I had to study the topic. The scripts are run by the template and on a regular chart, but without the ability to set input parameters. So PlaySound method will definitely work.
Nothing is working for me.
The set I sent in a private message works for me through OnInit in the Expert Advisor. It can be seen from the logs. Send me your logs.
I am posting an alternative variant of launching web requests - with the help of chart objects, in which a template with an expert helper is applied. It can be used both from experts and indicators. Dependencies are the same as in the article. Directly new files of the approach implementation:
For each query an object is created, an expert-helper is created in it, the object is deleted when the query is finished. Query data and results are exchanged via resources, as in the article.
Judging by the logs, this mechanism does not provide full-fledged parallelism of query execution, as the objects probably share a common event queue. Log example:
Try the updated Resource_Data.mqh, lags when transferring web pages should disappear.
Old version
New version
Try the updated Resource_Data.mqh, lags when transferring web pages should disappear.
Old version
New version
What did you have to do to speed up 20 times? Compatibility with old code remains, client calls don't need to be changed?
What did you have to do to speed up 20 times? Compatibility with the old code remains, client calls don't need to be changed?
Compatibility remains.
Forum on trading, automated trading systems and testing trading strategies.
Libraries: TradeTransactions
fxsaber, 2018.12.09 01:23 pm.
In the library sources there is Convert.mqh, which quickly converts an array of one type to an array of another.
TypeToBytes was slow (now only used if neither array type is a multiple of the other) on large arrays.
TypeToBytes is not used for uchar[].