This is a demonstration not only of GPU calculations in the MQL5 code, but also of the graphical capabilities of the terminal:
Full source code as a script is attached.
We are preparing an OpenCL staff library for maths and rendering, which will take a few weeks. It's going to be amazingly fast and beautiful.
In the meantime, take a look at the updated graphics library for rendering science graphs.
О! Soon it will come to games ))))
What for in a trading platform? Well, the calculations are understandable, and all sorts of beautiful things only seduce.
О! Soon it will come to games ))))
What for in a trading platform? Well, the calculations are clear, and all sorts of beautiful things only seduce.
With OpenCL you can use thousands of GPU cores to speed up mathematical calculations a hundred (several hundred) times.
This is exactly what is needed in trading and what will allow to move to the use of techniques that require orders of magnitude more calculation resources.
In MQL4 you dig with a shovel, while in MQL5 with OpenCL you get a tractor in terms of performance. To bring GPU calculations to the masses, we are preparing new math libraries in addition to the existing ones.
Couldn't get past it, passed it by
This is a demonstration not only of GPU calculations in the MQL5 code, but also of the graphical capabilities of the terminal:
The full source code as a script is attached.
Compiled it, ran it.
Does not work.
MT5 build 1491.
W7 prof SP1 eng 64-bit
Compiled it, launched it.
Look at the logs of the terminal and expert window.
The script is complex, just written and not yet debugged. It doesn't run everywhere without GPU.
Look at the terminal logs and the expert window.
The script is complex, just written and not yet debugged. It doesn't run everywhere without GPU.
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) <kernel>:188:18: error: subscripted access is not allowed for OpenCL vectors
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) uint b=(uint)(res[2]*255);
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) ^ ~
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) <kernel>:189:18: error: subscripted access is not allowed for OpenCL vectors
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) uint g=(uint)(res[1]*255);
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) ^ ~
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) <kernel>:190:18: error: subscripted access is not allowed for OpenCL vectors
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) uint r=(uint)(res[0]*255);
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1) ^ ~
2016.12.10 03:57:08.197 Seascape (GOLD-12.16,H1)
2016.12.10 03:57:08.218 Seascape (GOLD-12.16,H1) OpenCL program create failed
2016.12.10 03:57:36.695 Seascape (GOLD-12.16,H1) OpenCL: GPU device 'GeForce GTX 970' selected
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) <kernel>:188:18: error: subscripted access is not allowed for OpenCL vectors
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) uint b=(uint)(res[2]*255);
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) ^ ~
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) <kernel>:189:18: error: subscripted access is not allowed for OpenCL vectors
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) uint g=(uint)(res[1]*255);
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) ^ ~
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) <kernel>:190:18: error: subscripted access is not allowed for OpenCL vectors
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) uint r=(uint)(res[0]*255);
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1) ^ ~
2016.12.10 03:57:36.711 Seascape (GOLD-12.16,H1)
2016.12.10 03:57:36.730 Seascape (GOLD-12.16,H1) OpenCL program create failed
For more information I recommend reading our article on OpenCL in MetaTrader 5:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This is a demonstration not only of GPU calculations in the MQL5 code, but also of the graphical capabilities of the terminal:
The full source code as a script is attached. The bug on OpenCL 1.2 has been fixed.