Create dll file for MT5 using C#

 

Can I build MT5 DLL files with C#, or must I use C++ ?

If it's possible in C#, is there an example for this? 

 
B.Moreno: Can I build MT5 DLL files with C#, or must I use C++ ? If it's possible in C#, is there an example for this? 

Yes, you can use C#. In fact, you can build them in an language as long as you respect the formats of the parameters that are being passed between the two.

There should be some older Articles about C# DLL's. They may be outdated but still a valid starting point. You may just need to tweak them to work on the more modern versions of MetaTrader.

 

Articles

Exposing C# code to MQL5 using unmanaged exports

investeo, 2011.02.09 16:55

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#.

Articles

Developing graphical interfaces for Expert Advisors and indicators based on .Net Framework and C#

Vasiliy Sokolov, 2019.04.05 14:31

The article presents a simple and fast method of creating graphical windows using Visual Studio with subsequent integration into the Expert Advisor's MQL code. The article is meant for non-specialist audiences and does not require any knowledge of C# and .Net technology.

Articles

Developing graphical interfaces based on .Net Framework and C# (part 2): Additional graphical elements

Vasiliy Sokolov, 2019.06.25 13:08

The article is a follow-up of the previous publication "Developing graphical interfaces for Expert Advisors and indicators based on .Net Framework and C#". It introduces new graphical elements for creating graphical interfaces.