MT3 API for VB.net and C# - page 5

 

This is debugger issue, it works fine outside of that. Thanks.

 

I don't know where you got the error text, but I sometimes notice that the debug, local, and watch windows showing strange values, mostly when the code is break outside main thread. This is might a bug in VS Studio.

 

Thanks for the response on the VS bug.

Today I had some time to spend working on some ideas, and must have done too much work, because I started getting this error when connecting:

"An unhandled exception of type 'TooFrequentException' occurred in mt3apidotnet.dll"

I was hopeing in a few hours I could get back to work, but no such luck. I even created a new account, and that didn't work either.

Any ideas?

 

You should add 5 seconds between connection calls and 10 seconds between order exection calls. Sometimes, the error occour if you make connections to multiple brokers. Possible solution to lift the limit is spawning new mtapi object in separated appdomain. You'll need to do a bit of research on this.

Everyone, do you need full example and source code of the mt3 api wrapper?

 

scorpion,

It would have been very useful to have had the source code to your wrapper when I was working on my own. If you're thinking about releasing it, I'm sure others will find it helpful.

 

It would be nice to have the source to the API. I'm sure it would be helpful as a learning tool.

btw...has anyone implemented the wrapper using visual c#? I'm trying to do so now, but have run into a few problems. At run time I get an error saying it can't find the dll: 'System.DllNotFoundException' occurred in mt3apidotnet.dll. Please note that while I do this, I am also learning c#, so chances are it's a simple mistake.

Just wanted to see if anyone had a c# example I can learn from. Thanks!

 

A full example would be especially useful and very much appreciated. Is this what you were referring to in and earlier comment you made:

"Anyone longing for full example demonstrating connect & login, execute orders, and get open & closed orders"?

I would love to see what you could demonstrate.

Thanks.

 

Thanks to Charlie's sponsor, you can now fetch it from https://c.mql5.com/3/139/mt3api_dotnet_full.zip

Enjoys!

 

This is great, and much appreciated!

I'm running into a problem with this project that I was hoping you had seen before...

Sending orders works well for a while, but if I send an order or two, then wait several minutes, I sometimes get this error:

An unhandled exception of type 'SomeErrorException' occurred in mt3apidotnet.dll

Additional information: some error

The thread '' (0x950) has exited with code 0 (0x0).
An unhandled exception of type 'SomeErrorException' occurred in mt3apidotnet.dll

Additional information: some error

The thread '' (0xc44) has exited with code 0 (0x0).
The thread '' (0xc10) has exited with code 0 (0x0).
The thread '' (0x101c) has exited with code 0 (0x0).
An unhandled exception of type 'SomeErrorException' occurred in mt3apidotnet.dll

Additional information: some error

The thread '' (0x1310) has exited with code 0 (0x0).
The thread 'MT3 Pumping Message Loop' (0x15e0) has exited with code 0 (0x0).
The program '[1588] APIDemo.exe' has exited with code 0 (0x0).

I'm not sure how to get more information on this other than "some error". The error happens in Sub SendOrder, at:

' Send order
_API1.SendOrder(Order)

Thanks for any help you gan give.

-Tom

 

It's just a normal exception when your application is disconnected from metatrader server. All you can do is reconnect (remember disconnect first or reinitiate mtapi objects).

Hope this helps

Reason: