Discussion of article "How to Export Quotes from МetaTrader 5 to .NET Applications Using WCF Services"
Well done! I can't say anything else. Unfortunately, the MQL5 - .NET connection still requires an intermediary, which makes the whole construction too cumbersome.
Unfortunately, MQL5 - .NET communication still requires an intermediary, which makes the whole construction too cumbersome.
I agree. By the way, for simple interactions there is a great thing - Inverse P/Invoke - interaction without intermediaries.
I also tried to use ILMerge to merge all 3 assemblies into QExportWrapper.dll - it didn't work, or rather it did, but after merging from mql5 it doesn't see the exported functions
Hi!
I have copied your source files and recompiled them to run.
But I had a crash of the MT5.
How can I debug / troubleshoot on this?
Thanks!
1. The first, try to use the compiled files, located in the archive bin.rar
For example, the directory of MetaTrader5 client terminal is "C:\Program Files\MetaTrader 5\"
Let's create new folder for the expert QExporter.mq5 for example "QE", in the folder "C:\Program Files\MetaTrader 5\MQL5\Experts\"
C:\Program Files\MetaTrader 5\MQL5\Experts\QE\QExporter.mq5 (1615 bytes)
C:\Program Files\MetaTrader 5\MQL5\Experts\QE\QService.mqh (4380 bytes)
C:\Program Files\MetaTrader 5\MQL5\Libraries\QExport.dll (5632 bytes)
C:\Program Files\MetaTrader 5\MQL5\Libraries\QExport.Service.dll (7168 bytes)
C:\Program Files\MetaTrader 5\MQL5\Libraries\QExportWrapper.dll (27648 bytes)
C:\Program Files\MetaTrader 5\WindowsClient\QExport.Client.dll (6656 bytes)
C:\Program Files\MetaTrader 5\WindowsClient\QExport.dll (5632 bytes)
C:\Program Files\MetaTrader 5\WindowsClient\WindowsClient.exe (12288 bytes)
Then after the compilation of QExporter.mq5 the compiled file QExporter.ex5 will appear in the directory:
C:\Program Files\MetaTrader 5\MQL5\Experts\QE\QExporter.ex5 (6706 bytes)
After attaching it to the chart EURUSD,H1 and running WindowsClient.exe, I have got the following picture:
I have tested it at buld 249 (18 Feb).
I have copied your source files and recompiled them to run.
But I had a crash of the MT5.
How can I debug / troubleshoot on this?
Hello,
Fist of all, i would try to debug mql5 sources to find the function that causes an error - set up breakpoints before all dll functions calling. Unfortunately, i couldnt attach dll to terminal.exe for debugging because terminal has been crashed. Maybe in new builds its possible
Also i want to know which OS do you use. I have 32bit OS and therefore i didnt have an ability to check it on 64bit systems.
And have you tried to run compiled files?
And one more thing, please try to run ConsoleService and ConsoleClient in the solution. Maybe problem isnt related to mql or wrapper library.
Finnaly, i suppose you've just forgotten to create (or copy) file terminal.exe.config. Please try it.
It is a good news for MQL5 can use wrap dll of NET.
Why Mql4 can not use such mode to comm with Net wrapped DLL ?
It is a good news for MQL5 can use wrap dll of NET.
Why Mql4 can not use such mode to comm with Net wrapped DLL ?
Thank you very much for the posted example. For a week now (in the evenings) I have been struggling to create a library for data exchange between.net and mql5.
I am not good at C++ and this post was very useful to me.
There is only one problem. After compilation under x64, service initialisation gives an error.
ExportService^ service = gcnew ExportService(serverName); // <- ServiceManaged.cpp
The process just "quits" without any explanation.
How can I output this error to the log for further analysis? Or maybe you have already encountered this problem and there is a solution ????.
I managed to get both this working with both 32bit MT5 and, after recompling for x64, managed to get it working with 64bit MT5....however, when I try to run the EA in the strategy tester they both crash spectacularly.
I would like to use this to export some price and indicator data into a database table to do some analysis with external software.....any ideas what could be causing this crash? This is the closest I've come to a working solution so far.
Joe

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article How to Export Quotes from МetaTrader 5 to .NET Applications Using WCF Services is published:
Author: Alexander