Here's what you can do with OpenCL directly in MetaTrader 5 without any DLLs - page 16

 

I will check the rendition.

Without double maths there is nothing to do in our field. All the more so in 2020.

Whereas in the early days of OpenCL one could still look for compromises and be deceived by the notion "well, you can calculate something in float", today it is not so.

Any attempt to convert double -> int -> double completely kills performance and profit, especially on large sizes.

The correct option is to use native formats and more modern cards with new drivers.

 

The support is there:

OpenCL device name: GeForce GTX 1050 Ti with Max-Q Design
OpenCL device ext: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64
                   cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing
                   cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics


OpenCL device name: Intel(R) UHD Graphics 630
OpenCL device ext: cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics 
                   cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator 
                   cl_intel_driver_diagnostics cl_khr_priority_hints cl_khr_throttle_hints cl_khr_create_command_queue cl_intel_subgroups_char cl_intel_subgroups_long
                   cl_khr_fp64 cl_khr_subgroups cl_khr_il_progr
 
I will not argue about modern monetization model in IT. Buying one new hardware working at 25% of possible efficiency compared to using optimized algorithms will not cause global warming of course :)

We will postpone the subject of OpenCL and MT5 for a later date, when there is some spare money for a desktop computer in the family budget.

I have a favour to ask you, Renat. In MQL5 manual (OpenCL section) add a disclaimer saying that before using double data and calculations in graphics cards/graphical coprocessors, you have to be sure they are supported by these devices. So that MQL5 newbies do not have any illusions on old hardware.

Thanks for your time.
 
aim-1:

A request to you Renat. Please add in the MQL5 manual (OpenCL section) a disclaimer stating that before using double data and calculations in graphics cards/graphical coprocessors, you should verify that they are supported by these devices. So that MQL5 newbies do not have any illusions on old hardware.

This is already written in the automatic map test and it is not selectable: done in the latest release

OpenCL  test compilation failed with error: use of type 'double' requires cl_khr_fp64 extension to be enabled 

It is safe to say about old maps without double support that they are absolutely useless for mathematical calculations.

This is the reality.

 
Renat Fatkhullin:

This is already written in the automatic map test and it is not selectable: done in the latest release

I have a lot of respect for MetaQuotes. Very good platforms are developed and maintained by you.

Disclamer (system requirements) is logical if you want to keep track of reputation. Because naive beginners (like me:) get excited by an interesting feature, picked up on the net, and having failed at launching MT5, may cool down to a new platform, because they get an impression that there are potentially other failures while using it. For example, the need to understand OOP in standard libraries, etc.

By the way, it would be useful to have a template of a simple trading Expert Advisor without OOP (preferably directly on the MT5 website), so that even the MQL4 infants could quickly get used to MQL5, while having full control over the code. In this sense, a new MQL5 tutorial (preferably shorter - without rehashing old ones) would be a good idea. Then the trading community (the main engine/stopper of progress) would crawl to a new platform faster.

Thanks again for your hard work.
Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека MQL5 написана на языке MQL5 и предназначена для облегчения написания программ (индикаторов, скриптов, экспертов) конечным пользователям. Библиотека обеспечивает удобный доступ к большинству внутренних функций MQL5.
 
aim-1 : I respect MetaQuotes. Very good platforms are developed and supported by you.

Disclaimer (system requirements) is logical if you want to monitor your reputation. Because naive newbies (like me :) caught fire of interesting features picked up on the network and broken off when MT5 is launched can cool down for a long time to the new platform, as it seems that other breakdowns are potentially possible when using it. For example, the need to understand OOP in standard libraries , etc.

With OOP, by the way, it would be nice to officially lay out (better, right on the MT5 website pages) a template of a simple trading Expert Advisor without OOP, so that even MQL4 babies can quickly get involved in MQL5, while fully controlling the work of the code. In this sense, a new textbook on MQL5 (preferably shorter - without repeating the old water) would not hurt. Then the trading community (the main engine / stopper of progress) will crawl to the new platform faster.

Thanks again for your hard work.

Some examples come with the MQL5 package. Totally procedure-oriented programming. I'm not sure about MQL4

 
Not clear
//test.mqh
void f( int ii )
{
        for ( int i = -ii; i <= ii; i++ )
        {
                int j = CLContextCreate( i );
                if ( j != -1 )
                {
                        CLContextFree( j );
                        Print( ii, ":", i, ":", j );
                }
        }
}
#include "test.mqh"
void OnStart() { f( 32765 ); }
Result:
32765:0:2147352576
32765:1:2147418112

and if

#include "test.mqh"
void OnStart() { f( 32766 ); }

Result:

32766:0:2147418112

Why is there one output (line) in one case and two in the other?

 
A100:
Not clear Result:

and if

Result:

Why is there one output(line) in one case and two in the other?

Thank you for the message.
Fixed.

OpenCL handle overflow due to frequent over usage of the handle, more than SHORT_MAX times

 
Apparently they solved the problem drastically, now it doesn't work either
void OnStart()
{
        if ( CLContextCreate( 0 ) == -1 ) Print( GetLastError() ); //5114

}

and a week ago it was working fine. Why disable OpenCL if there is no support for double and it is not used?

 

Yes, decided not to use old cards without double support at all.

The old cards in general are very bad, including bad unrepaired drivers that often crash, dropping the terminal.

The reality is that you should already explicitly control the versions of the drivers, like the developers of PC games do. Microsoft's default drivers won't get you very far.
Reason: