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

 
I have encountered some difficulties in implementing the above. That's why I'll tell you about it, in case someone faces similar problems.


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");
}

By the way, this article is also true for MT4. Although MT4 has DDE, I like this approach better. Everything works great.

P.S: Thanks to the author of the article! Everything is cool!
 
I don't understand, it's well written but it doesn't work. QEXPORTWRAPPER doesn't run on a 64-bit terminal.
 
shelandr1:
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

Документация по MQL5: Файловые операции / FileOpen
Документация по MQL5: Файловые операции / FileOpen
  • www.mql5.com
Файловые операции / FileOpen - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

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 

Freelance service at MQL5.com: Make Visual Studio 2012 solution downloaded from article work with Metatrader 5 64 bits
Freelance service at MQL5.com: Make Visual Studio 2012 solution downloaded from article work with Metatrader 5 64 bits
  • www.mql5.com
Hi, I'm a C# developer and downloaded the code from the article "HOW TO EXPORT QUOTES FROM METATRADER 5 TO .NET APPLICATIONS USING WCF SERVICES" ( https://www.mql5.com/en/articles/27 ). The problem is that my machine is a Windows 64 bits with MetaTrader 5 64 bits installed and I had to change the compile configurations to 64 bits in Visual Studio 2012. Ok, it compiled normally, then I added one new method that aims to return a string to MT5 which i called ReadBroker2MeInstructions . Compiled...
 

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.

 
sabe:

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.