Advantages of our MT5 Manager .NET API

easy direct connection to any MT4 and MT5 server

Advantages of our MT5 Manager .NET API

Official MT5 Manager .NET API have several disadvantages that we solved in our wrapper.

1. In official API all fields made as methods.

For example to get user login:

CIMTUser user;
var login = user.Login();

To set user login:

CIMTUser user;
user.Login(1000);

This way very uncomfortable in development because if you add CIMTUser struct to watches you cannot all fields together, you need to request them one by one.
And with this way also difficult to serialize and deserialize. You cannot do something like this:

CIMTUser user;
var serialized = JsonConvert.SerializeObject(user);
var usr = JsonConvert.DeserializeObject<List<ShopItem>>(serialized);

All of this problems solved in our wrapper where all fields it's usual .net fields:

    public class User
    {
        public UInt64 ClientID { get; set; }
        public String FirstName { get; set; }
        public String LastName { get; set; }
        public UInt64 Login { get; set; }
        ...

2. With our wrapper don't need to care about memory leaks.

In official API you need to call Release() method when you don't need a struct anymore:

var user = manager.UserCreate();
// some actions
user.Release();

If you forgot to call user.Release() you will have memory leaks because garbage collector do not call Release() method you always need to call it manually.
With our wrapper you don't need to care about calling Release(), you can use structures the same as usual .net objects. And can be sure all memory would be released by garbage collector.
With our wrapper you can do simply like:

var user = new User();
// some actions
// and no need to care about memory leaks

3. In official API all enum fields have uint type.

Example:

var user = manager.UserCreate();
uint rights = user.Rights();

In our wrapper all enum fields have correct type:

public class User
{
    public UsersRights Rights { get; set; }
}
[Flags]
public enum UsersRights : ulong
{
    USER_RIGHT_NONE = 0uL,
    USER_RIGHT_ENABLED = 1uL,
    USER_RIGHT_PASSWORD = 2uL,
    USER_RIGHT_TRADE_DISABLED = 4uL,
    USER_RIGHT_INVESTOR = 8uL,
    USER_RIGHT_CONFIRMED = 0x10uL,
    USER_RIGHT_TRAILING = 0x20uL,
    USER_RIGHT_EXPERT = 0x40uL,
    USER_RIGHT_OBSOLETE = 0x80uL,
    USER_RIGHT_REPORTS = 0x100uL,
    USER_RIGHT_READONLY = 0x200uL,
    USER_RIGHT_RESET_PASS = 0x400uL,
    USER_RIGHT_OTP_ENABLED = 0x800uL,
    USER_RIGHT_SPONSORED_HOSTING = 0x2000uL,
    USER_RIGHT_API_ENABLED = 0x4000uL,
    USER_RIGHT_PUSH_NOTIFICATION = 0x8000uL,
    USER_RIGHT_DEFAULT = 355uL,
    USER_RIGHT_ALL = 61311uL
}

4. In officail API using of events it's quite complex task.

In our wrapper it's very easy:

MT5Manager man = new MT5Manager();
man.Login(server, user, password, timeout);
man.OnQuote += delegate(MT5Manager sender, Quote quote)
{
    Console.WriteLine(quote.Symbol);
};

Leave a Reply