MetaTrader 5 Python User Group - how to use Python in Metatrader - page 24

 
Maxim Dmitrievsky:

Visually similar cases are also not badly detected.

Couldn't interpret the pictures.

 
fxsaber:

Couldn't interpret the pictures.

article on the way

it's interesting how cycles and objectives sometimes coincide in some people's heads ))
 
fxsaber:

I've posted a calculation on the blog that parallels perfectly. Unfortunately, the OpenCL information is of such a level that it requires much higher competence than I have.

I would like to see a simple example (like in the blog) of OpenCL implementation and the result of acceleration.

Why talk without a link, although there is a requirement?
 
Renat Fatkhullin:
Why is there no link, even though there is a requirement?

There is no claim. I have not provided a link to the blog entry so as not to give rise to accusations of self-promotion.

https://www.mql5.com/ru/blogs/post/731774

Research03: находим простые связи между движениями цены в разных частях суток
Research03: находим простые связи между движениями цены в разных частях суток
  • 2019.12.04
  • www.mql5.com
Как это ни парадоксально, но именно при активной алготоровле много времени уходит на вглядывание в монитор. Иногда возникают иллюзии, будто что-то полезное уловил глазом. Так произошло и в этот раз. Давно была гипотеза, что какие-то движения внтури дня имеют связь с движениями после в этом же дне. Например, может показаться, что микрогепы в...
 
Renat Fatkhullin:

I (and everyone else) haven't been able to see the use of this parameter in Visual Studio for the last 10 years. Even having turned on all the loop sweep reporting flags.

It simply didn't work and doesn't work even on large projects where there are a lot of possibilities to parallelize. Only direct OpenMP with manual loop partitioning works.

In MQL5, the loops are not paralleled.

I agree with fxsaber that OpenCL requires a high entry threshold.
The fact that it is there is good, but only a few are good at it.

The fact that loops in mql5 are not parallel, that was the suggestion for possible implementation.
Now the platform is in Clang, maybe there is good parallelism there, I don't know.
The point of the proposal is to pull it into mql directive.

 
Renat Fatkhullin:

Do I understand correctly that if you set this task to find similar motions to the Optimizer, then genetics will not work?

In this case, the Tester will not be enabled for a full enumeration, as there are a lot of passes to be made.

I.e. the only way to solve this problem is to run the script in Terminal.

 
Lyuk:

Decided to check on a real project - maybe python uses jit compiler all the time? I've got ranger https://github.com/ranger/ranger, project with 122 files (26368 lines), pinged them for @njit.

$ grep '@njit' $(xbps-query -f ranger)

Result - not a single find. I'm afraid that active use of this feature will turn the startup into a multi-minute quest.

 
Lyuk:

With all due respect, you just don't know how to cook it. Reworked your example:

In Python:


Here is a comparison in Python 3.8 and MQL5 in single thread/OpenCL modes: time in seconds, the less the better

pi-single.py
pi-multi.py
Speed PI.mq5 single
Speed PI.mq5 OpenCL
4.1743
0.2101
4.1836
0.1025

Python in JIT mode via numba, the iron is:

  • Windows 10 x64, Intel Xeon E5-2690 v3 @ 2.60GHz
  • GeForce RTX 2080

The example of using OpenCL is very simple and it does not require any frills for optimization. Although the task is not massive for OpenCL and it triggered overheads in preparation, it still gave a much better result.

Very large parallel calculations can be routinely run with OpenCL. The entry threshold is not high and it only takes a day to figure out how to use it.

Files for playback attached.

Files:
 
Renat Fatkhullin:

Although the task is not massive for OpenCL and it triggered overheads in preparation, it still gave a much better result.

How did you debug the OpenCL part of the code?

 
Renat Fatkhullin:

The example of using OpenCL is very simple and without any frills for optimization. Although the task is not massive for OpenCL and it has triggered overheads in preparation, it still gave a much better result.


Renat, can you give me an approximate idea of the cases in which OpenCL will have an advantage, working with a large number of arrays or if there is a large set of symbols and indicators in one EA?

I am not a pro programmer, simple things at the programming level are probably difficult for me