View Single Post
  #26 (permalink)  
Old 05-23-2008, 09:04 PM
bwilhite bwilhite is offline
Member
 
Join Date: Aug 2006
Posts: 97
bwilhite is on a distinguished road
Since I was here, I thought I'd share my experience. What you are wanting to do can certainly be done, and I've done it many times myself.

When I first started writing DLLs for use in MT4 I couldn't ever get it to work in C++. I think the problem was/is that my project settings were always incorrect in Visual Studio (there's so d@$% many of them). Just recently I found an example from CodeGuru, which I was actually able to compile and use. Now I basically cleaned out that project and use it as a template.

In the meantime, I've been writing C# DLLs and using this excellent tool here. It basically takes the IL and alters it so that it can be called from unmanaged code. The only problem is that MT4 seems to exhibit a memory leak when doing this. I haven't definitively determined if that's due to MT4 or the altering of the IL, or what, but it happens.

Next I'll either be learning to write wrappers on C++ and/or just go ahead and learn C++. Hopefully that will address the memory issue.

Anyway, what you are wanting to do can definitely be accomplished. I've managed to write some pretty complicated DLLs for MT4 in C#, including things like remoting, raw sockets, http, WinForms. Pretty much anything you can do with .NET can be called from MT4 this way (you name it, and I've probably done it). And it's very reliable. The only problem is the relatively slow memory leak.

Quote:
Originally Posted by Magick View Post
Thanks Patrick

thats a very interesting idea to use the FTP.

however I do want to be able to interact with MT - to send the tick and candle info to the .net app and this app communicate back to MT on when to trade.

I found this that I thought may help - Simplified Wrapper and Interface Generator
However I am a rather entry level programmer, and dont fully appreciate what is involved in having a c++ wrapper middle layer.

I would be interested to hear your opinion, if you think this could be a useful tool to use to help bridge between the c++ and .net?
Reply With Quote