I wish to have Metatrader send more data via DDE than just current quotes. A spreadsheet application with tables and graphs can sometimes describe the market much better than indicators.
And so I decided to write a DLL that will proide functions to create and support more topics for the DDE server of MT4. The DLL so far export a function to create a topic/item pair:
Unfortunately when I try to access this topic/item from Excel like "=MT4|testMt4Topic!TestItem" it does not seem to connect ( =MT4|BID!EURUSD works just fine ) . Also on some occasions the terminal crashes but it is not too bad.
Has anybody tried this before and has ideas what could be wrong or is it even possible? In all DDE examples that I could find, they talk about acquiring a handle to the application window but in my DLL I have no windows at hand.
[ C++Builder source is attached ]
_______________________________
After lots more searching I've found no way to do exactly this. But maybe I've figured a way around it. There is a commercial application DDETool that does it and from screenshots on their website it looks like they use a proxy application that acts as a DDE server for Excel to connect to. An expert runs in Metatrader that sends the data to the proxy DDE server.
Though not the greatest way to do the job it is still something to go with
And so I decided to write a DLL that will proide functions to create and support more topics for the DDE server of MT4. The DLL so far export a function to create a topic/item pair:
Inserted Code
#import "DDE_Srvr.dll" int startDdeTopic(string topicName, string itemName); #import .... int init() { startDdeTopic("testMt4Topic", "TestItem"); return(0); }
Has anybody tried this before and has ideas what could be wrong or is it even possible? In all DDE examples that I could find, they talk about acquiring a handle to the application window but in my DLL I have no windows at hand.
[ C++Builder source is attached ]
_______________________________
After lots more searching I've found no way to do exactly this. But maybe I've figured a way around it. There is a commercial application DDETool that does it and from screenshots on their website it looks like they use a proxy application that acts as a DDE server for Excel to connect to. An expert runs in Metatrader that sends the data to the proxy DDE server.
Though not the greatest way to do the job it is still something to go with
Attached File(s)
dde_server.cpp.txt
3 KB
|
646 downloads