NVIDIA CUDA for strategy testing

 

Any of the programmers here know how to setup CUDA to work with the MetaTrader 5

strategy tester?  I have a very expensive GPU with liquid cooling just hanging out

while my CPU could use the help.  I am surprised actually this is not implemented into

the MT5 software.

 

V/R

Bruce Lesko 

 
Redfox:

Any of the programmers here know how to setup CUDA to work with the MetaTrader 5

strategy tester?  I have a very expensive GPU with liquid cooling just hanging out

while my CPU could use the help.  I am surprised actually this is not implemented into

the MT5 software.

 

V/R

Bruce Lesko 

I can't find the link right now but the only way currently is to write your own native library (dll) which you can import into your EA. Inside the native code library you would call your CUDA or OpenCL code. This may or may not help with backtesting depending on the types of operations your code runs. So basically you have your EA and then explicitly offload your GPU calculations through your own custom code.  Here is a link to compiling native code for MT5 using Visual Studio.

https://www.mql5.com/en/articles/249

It's a pain to figure this out, but I have successfully done this in Visual Studio 2010 and Visual Studio 2012 for both MT4 and MT5 using the same code. Note, I had to place my DLL's in the AppData folder for each terminal before they would work.

Exposing C# code to MQL5 using unmanaged exports
Exposing C# code to MQL5 using unmanaged exports
  • 2011.02.09
  • investeo
  • www.mql5.com
In this article I presented different methods of interaction between MQL5 code and managed C# code. I also provided several examples on how to marshal MQL5 structures against C# and how to invoke exported DLL functions in MQL5 scripts. I believe that the provided examples may serve as a basis for future research in writing DLLs in managed code. This article also open doors for MetaTrader to use many libraries that are already implemented in C#.
 
Redfox:

Any of the programmers here know how to setup CUDA to work with the MetaTrader 5

strategy tester?  I have a very expensive GPU with liquid cooling just hanging out

while my CPU could use the help.  I am surprised actually this is not implemented into

the MT5 software.

 

V/R

Bruce Lesko 

Been asked before https://www.mql5.com/en/forum/9249#comment_384627
 

Redfox - Just use A mql5 cloud!

Why would you need to think about gpu acceleration when cloud is so powerful that there is almost idle all the time. On average only 50k jobs/monthly.

Read this article: Speed Up Calculations with the MQL5 Cloud Network


I think there is no need for gpu acceleration.

Statistics - MQL5 Cloud Network
Statistics - MQL5 Cloud Network
  • cloud.mql5.com
Amount of produced work, agents distribution by countries, RAM, CPU and OS bit count
 
CeleronS:

Redfox - Just use A mql5 cloud!

Why would you need to think about gpu acceleration when cloud is so powerful that there is almost idle all the time. On average only 50k jobs/monthly.

Read this article: Speed Up Calculations with the MQL5 Cloud Network


I think there is no need for gpu acceleration.


Cause one GPU can calculate as much as hunderts of CPU or more, depending on what calcuclatiions you run, and cause you don't have to pay other if you use ur own GPU..
Pretty obvious why, don't you think?
If you run a lot of calculations that run bether on GPUs it sure is worth it.

Personally I would prefer it if he uses the cloud so my CPUs have something to do ;) 

 
Deatheye:

Cause one GPU can calculate as much as hunderts of CPU or more, depending on what calcuclatiions you run, and cause you don't have to pay other if you use ur own GPU..
Pretty obvious why, don't you think?
If you run a lot of calculations that run bether on GPUs it sure is worth it.

Personally I would prefer it if he uses the cloud so my CPUs have something to do ;) 

Yeah, I know where you are coming from. I used to have that enthusiasm too. I know all that great stuff about shader processors and how they can work extremely efficient compared to x86 architecture (Say 100 fold more efficient).

But it's extremely hard to make GPU to calculate those history works, cuz for GPU it's all about parallel.


And actually - WHY BOTHER?

The problem was - Extremely long optimization process.  And MQ did find solution - CLOUD. Easily faster than any latest quad sli (single offline system).

Just think about that: You don't need to optimize your EA all the time. While you can provide agents all the time. And they do some calculatins and adds some credit to your account. That all accumulates and when you need a optimization boost - it's there.

Think about cloud like me - thats optimization battery. You charge it,charge it,charge it, and then KABOOM(get results quickly and probably while sitting in some beautiful park with your low energy mobile device).

Btw: I supply agents too and here electricity prices are so dear, that I only can be profitable if all cloud capacity is utilized. Since there is no luck on that. I just want to see some crazy spikes someday, thats is all I need for satisfaction.

Server guy/overclocker fantasy ^^


Cheers!

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties - Documentation on MQL5
 
CeleronS:

Yeah, I know where you are coming from. I used to have that enthusiasm too. I know all that great stuff about shader processors and how they can work extremely efficient compared to x86 architecture (Say 100 fold more efficient).

But it's extremely hard to make GPU to calculate those history works, cuz for GPU it's all about parallel.


And actually - WHY BOTHER?

The problem was - Extremely long optimization process.  And MQ did find solution - CLOUD. Easily faster than any latest quad sli (single offline system).

Just think about that: You don't need to optimize your EA all the time. While you can provide agents all the time. And they do some calculatins and adds some credit to your account. That all accumulates and when you need a optimization boost - it's there.

Think about cloud like me - thats optimization battery. You charge it,charge it,charge it, and then KABOOM(get results quickly and probably while sitting in some beautiful park with your low energy mobile device).

Btw: I supply agents too and here electricity prices are so dear, that I only can be profitable if all cloud capacity is utilized. Since there is no luck on that. I just want to see some crazy spikes someday, thats is all I need for satisfaction.

Server guy/overclocker fantasy ^^


Cheers!


Why bother?  I did state that I have a very expensive GPU already.  WHY NOT BOTHER???  You should always use the resources you own rather then always paying someone else rent when possible.  The link the moderator gave goes to another post of his that tells someone else to use the search function as well and eventually leads to a helpful article.  Thank you, I will read it when I have free time and see if a suitable answer is available.

OpenCL: The Bridge to Parallel Worlds


 

Do you make your own electricity too?


Sure if you don't value your time much, you can take part of programming and probably somehow make GPU to take off some load of calculations to faster extract results.


Sell your expensive gpu and put small portion 50-100$ on your mql5 account for cloud work. You won't believe how much work in short time cloud will do.


Sorry, but just have feeling that you are more interested in thinkiring about hardware and software not getting your job done.


 
CeleronS:

Do you make your own electricity too?


Sure if you don't value your time much, you can take part of programming and probably somehow make GPU to take off some load of calculations to faster extract results.


Sell your expensive gpu and put small portion 50-100$ on your mql5 account for cloud work. You won't believe how much work in short time cloud will do.


Sorry, but just have feeling that you are more interested in thinkiring about hardware and software not getting your job done.


I do use the cloud regularly and have even donated my agents to the cloud at times when I was not using my computer.  If I had the means to make my own electricity I sure would if it saved me money.  My electricity is actually free... but the topic is not about my electric bills.  If I did not already own the hardware (GPU) then I would not care if the software did or did not use it.  As I own the hardware I would like the software to make use of it.  I am not a programmer, hence why I ask the MQ5 community in the forums.  I would see it as a benefit to the whole community if we all could use the extra processing power.  I am not alone in thinking this either, as the article I linked to points out that this is something others are interested in as well.  Do not add more comments unless you have information to help.
 
My reply in that link also applies for implementing CUDA in MT5.
 
TripleHeinz:
My reply in that link also applies for implementing CUDA in MT5.
Even if MQ adding GPU calculation power to Strategy Tester, I think MQ will choose OpenCl instead of CUDA. That's because OpenCL is open source and CUDA is limited to NVIDIA.