darwinex / dwx-zeromq-connector

Wrapper library for algorithmic trading in Python 3, providing DMA/STP access to Darwinex liquidity via a ZeroMQ-enabled MetaTrader Bridge EA.
https://blog.darwinex.com/zeromq-interface-python-r-metatrader4/
BSD 3-Clause "New" or "Revised" License
344 stars 228 forks source link

[SOLVED] MQL4 OrderModify Error 4112 #16

Closed scwall closed 5 years ago

scwall commented 5 years ago

Hello I have an unknown error when I try to modify a trade or create a trade, I can still get the json answer from all my trades but I don't have the possibility to send it. Do you have any leads so I can debug this error? Thank you in advance

[INIT] Ready to send commands to METATRADER (PUSH): 32768
[INIT] Listening for responses from METATRADER (PULL): 32769
[INIT] Listening for market data from METATRADER (SUB): 32770
{'_action': 'OPEN_TRADES', '_trades': {464727: {'_magic': 0, '_symbol': 'EURUSD.', '_lots': 0.01, '_type': 0, '_open_price': 1.12393, '_open_time': '2019.06.06 11:18:41', '_SL': 0.0, '_TP': 0.0, '_pnl': 0.01, '_comment': ''}}}

{'_action': 'MODIFY', '_response': '4112', '_response_value': 'unknown error', '_sl_attempted': 1.12193, '_tp_attempted': 1.12893}
integracore2 commented 5 years ago

Hi @scwall ,

Error 4112 refers to ERR_TRADE_EXPERT_DISABLED_BY_SERVER in MQL4.

Essentially it means that the EA's "Common" settings have "Allow live trading" unchecked, OR the "AutoTrading" button on the Terminal isn't clicked.

This can also happen if you e.g. login to a different account when the EA was already running on a chart while logged into the previous account.

These settings are MetaTrader specific (cannot be controlled by the EA or the Python script). You can alter these under Tools -> Options in MetaTrader 4.

Could you kindly check to see if Allow live trading / AutoTrading are enabled?

scwall commented 5 years ago

thanks for this quick answer. I could see that all options were enabled, I could test a stop of a trade this one sends me back that it was successfully closed, but this one remains active in metatrader 4 {'_action': 'CLOSE', '_ticket': 464804, '_close_price': 1.12385, '_close_lots': 0.01, '_response': 'CLOSE_MARKET', '_response_value': 'SUCCESS'} three one two

scwall commented 5 years ago

I would like to apologize for the screenshots by looking a little bit on the net I realized that you were a trading platform. I just signed up for it. I clearly prefer to work with you who develop tools for developers :)

integracore2 commented 5 years ago

No worries at all @scwall 🙂

Thank you for your feedback, and for considering Darwinex as your platform!

We only test our code releases on Darwinex terminals, hence we're unfortunately unable to provide feedback for other broker's terminals.

Please always feel free to ask as many questions as you need, we're here to help as best as we can 💪

scwall commented 5 years ago

it's perfect! :thumbsup: everything works perfectly with your mt4 platform, I close the ticket :heart:

integracore2 commented 5 years ago

That's great to hear! Glad you've found our solutions useful 👍

Welcome to Darwinex 🙂 💪