dingmaotu / mt4-server

Turn MetaTrader Terminal into a Redis compatible server with ZMQ sockets
Apache License 2.0
166 stars 95 forks source link

Redis server: Object exists #9

Closed venzen closed 1 year ago

venzen commented 1 year ago

I can connect to the Mt4ServerRaw via a redis-py. I'm able to send the command ORDERS and get a list of open trades. When I give the BUY, SELL or CLOSE commands the server acknowledges the command in the MT4 Terminal's "Experts" tab, for example:

2023.01.23 10:56:54.046 Mt4ServerRaw XAUUSD,M15: >>> Received command: [b"SELL",b"XAUUSD",b"0.25"]

However, my redis client receives the response:

Failed to sell at market with error id (4112): object already exists

I get similar responses (object already exists) for BUY and CLOSE. Any ideas?

venzen commented 1 year ago

Well, the answer is right there in the error message: error code 4112.

4112 | ERR_TRADE_EXPERT_DISABLED_BY_SERVER | Automated trading by Expert Advisors/Scripts disabled by trade server

So after changing to a broker account that allows the use of EAs, Redis commands work just fine. Thank you for a great tool @dingmaotu