vdemydiuk / mtapi

MetaTrader API (terminal bridge)
http://mtapi4.net/
MIT License
514 stars 277 forks source link

Not able to use MtApi EA with investor password #223

Closed eabase closed 3 years ago

eabase commented 3 years ago

Problem:

The EA get unhappy if you use a non-tradable account for MT login credentials. This presumably prevent further use of the EA & API.

Expected We should be able to do all normal operations , apart opening a trade, even when using investor credentials. :)

eabase commented 3 years ago

@vdemydiuk Is there a way you can modify the EA to allow using it also with an investor password?

eabase commented 3 years ago

This is probably related to #78.

eabase commented 3 years ago

Easy fix:

    if (IsTradeAllowed() == FALSE) {
        MessageBox("Trading is Disabled.", "MT4 API EA", MB_OK);
        //isCrashed = TRUE;
        //return (1);
    }
vdemydiuk commented 3 years ago

@eabase Yes, you are right. This checking prevents using MtApi with non-tradable accounts. It was added on the begining of the project and it is not actual for now. I will remove code that stops experts if trade is not allowed (for both versions, MT4 and MT5). User always can check this mode in runtime by calling function: IsTradeAllowed() - MT4 TerminalInfoInteger(property TERMINAL_TRADE_ALLOWED) - MT5.