Discussion of article "How to Export Quotes from МetaTrader 5 to .NET Applications Using WCF Services" - page 3

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1) If you have an x64 terminal, you will most likely need to recompile your C++ project in x64. To be on the safe side, you should do it this way: Visual Studio -> Properties (of your C++ project) -> Configuration Manager -> and change it to x64 via the drop-down list or <New...>. Compile. Done. If it doesn't compile - check the References of the project, go through the compiler errors.
2) I had problems with the EA, it didn't even initialise. I noticed it only when disconnecting the EA from the chart, when the error init failed (funny...). The EA fell into infinite Sleep at the initialisation stage and it was all about these lines (in QService.mqh):
QService::EnterCriticalSection()
{
while (GlobalVariableCheck("QService_CriticalSection") > 0)
Sleep(1);
GlobalVariableTemp("QService_CriticalSection");
}
After debugging and vain attempts to understand this "Sleep(1)", I replaced the code with:
QService::EnterCriticalSection()
{
if(!GlobalVariableCheck("QService_CriticalSection"))
GlobalVariableTemp("QService_CriticalSection");
}
P.S: Thanks to the author of the article! Everything is cool!
Very interesting...Thank you...But maybe today there are simpler options*???
Of course there is - using the connection via the in-built capability of the terminal. It's a PIPE channel.
https://www.mql5.com/ru/docs/files/fileopen
Just posted a new job based on this article: https://www.mql5.com/en/job/34392 .
It's not working in my MT5 64 bits environment...
Great article!
Thanks
Just for knowledge, I discovered what happened in my 64 bits machine.
After hours and hours of researching and debugging, discovered that one referenced assembly was not loading, generating the exception "System.IO.FileNotFoundException: Unable to load file or assembly 'QExport.Service, Version=1.0.5771.13857, Culture=neutral, PublicKeyToken=56996a45dd1e337b'".
Maybe because the dll has no config file, don't know yet, MT 5 did not know where to find the assembly. So it was trying to get it in the base path (path where metaeditor64.exe is located). After changing the output directory of the referenced projects to that path, worked as a charm.
Hi Joe,
Was there any special trick to get it working on x64? I've just compiled it for x64, but the dll crashes with weird errors on startup.
Sabe, see my answer below.
[]'s
Hello,
I have tested your finished file, everything looks good in MT5. But there is no data in the WinClient.
I wonder if there is a similar project with pre-loading of historical bars? I would like to add it all to Lightweight-Chart and use the chart conveniently.