|
|||
|
firstly let me say that the wrapped .net mtapi is a godsend and I can't thank you enough for makign it available to the public. I am, however, having a little trouble with some of the functions. In particular the GetHistoricalRates function. While this doesnt give me any errors, the array I assign it to doens't get populated.
perhaps it's the way I@m calling it? GetHistoricalRates("EURUSD", period, new DateTime(2005, 6, 10, 0, 0, 0)); |
![]() |
|
|||
|
apologies scorpion .... was me being incredibly stupid. I forgot to login first before makign the function call. I hang my head in shame ... I'll refrain from asking you such stupid questions in future!
|
|
|||
|
scorpion,
is there a method in the wrapped api that will allow me to get the user info like balance, equity and free margin? I can se the structure is there but there appears to be no method for retrieving this info. thanks steve |
|
|||
|
Quote:
steve |
|
|||
|
Quote:
I've been lurking around here for a while, picking up a few tidbits here and there as I develop my own automated trading system. I don't know about you, but I've been extremely frustrated by the lack of documentation available for the MT3 API. I've had to discover most things through trial & error... ![]() Anyway, I've run into a problem I can't figure out. I'm using API version 3.72 (are there any other versions?) I'm accessing the DLL from a wrapper written in Perl (and C) running on cygwin. The problem is this: the BriefUserInfo struct returned by MtGetTradeRecords contains incorrect values for some of the fields, and it does so inconsistently. Some examples:
Weird, huh? Besides this little issue, everything else is working just fine so far. Any ideas? Have you encountered similar behavior? Could it have something to do with the server I'm using (currently the StrategyBuilderFX demo server)? As usual, it's probably something stupid that I'm doing...but I've wasted several hours already so it can't hurt to ask. ![]() Thanks for your help, and for this forum! |
|
||||
|
Hello,
I have never had these problems before. It seems that I correctly wrapped the api in vb.net. ![]() I think your problem likely lies within the wrapper itself. It is weird enough to wrap the api in Perl and C and then run on Cygwin. As far as I know, mt3 api doesn't work well with Cygwin. The mt3 api is already in C, so no need to rewrap in C, and Perl is not the right language to do the job--the main problem might due to the structure marshalling of Perl as well. Have you check the type/structure interoperatibily of C and Perl? Anyway, which language do you use to write the trading bot? |
|
|||
|
Somehow I knew you were going to say something like that.
Actually, all other parts of the wrapper are working correctly, so I don't think there's a flaw in my decision to use Perl for the wrapping. It did take some doing, though...I had to dust off my C skills to deal with that "structure marshalling" and what-not between Perl and C, as I had never worked with the Perl internals before. I used a module called Inline::C, which allows one to embed C code in Perl. It was a bit tedious but quite interesting.The reason it must run under Cygwin is so that I can compile that C code (I don't own any M$ compilers), load the DLL, as well as call Win32 API functions to create an invisible window for the pumping messages. I'm not a big fan of Windows--the rest of the system is written entirely in Perl and runs on Linux, with a web interface. The Windows portion just acts as a "proxy" for the MT server, and actually runs in a virtual machine on VMWare, on the Linux server itself. If anyone knows of a way to load a DLL and make the neccessary Win32 calls on UNIX, let me know! Perhaps something like Wine would do it? I must admit I don't know very much about such things... I guess I'll keep working on the remaining parts of the system and hopefully the answer will come to me. I think I'll first try connecting to a different demo server, just to eliminate that possibility. Oh, I meant to ask before--how often do you get your UPDATE_TRADES messages? I expected they would arrive quite often, particularly when a trade is open, but I'm not seeing very many, sometimes none at all. Guess this may be another bug... Thanks again. Feel free to PM or email me if you'd like to discuss this or related things. We seem to be working towards similar goals. ![]() |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Socket problems with MT3 API | fxtrader625 | MetaTrader and ZeroCode | 2 | 12-29-2005 12:26 PM |
All times are GMT. The time now is 11:35 AM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now












Linear Mode


