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
342 stars 227 forks source link

Litte bug with some Pairs #90

Closed osoluche closed 3 years ago

osoluche commented 3 years ago

In first place, let me said thank you for your great job, it's amazing, in second place well .... let me explain this bug;

In some pairs, not accept SL or TP, even with normalized values, such USDCHF, this is the json formatted with ordered_dict(), and supplied values:

{ '_action': 'OPEN', '_type': 0, '_symbol': 'USDCHF', '_price': 0.0, '_SL': 0.91541, '_TP': 0.92501, '_comment': 'Darwinex Test, '_lots': 0.01, '_magic': 123456, '_ticket': 0 } In console catch fine

DWX_ZeroMQ_Server_v2.0.1_RC8 TRADE;OPEN;0;USDCHF;0.0;0.91541;0.92501;Darwinex Test;0.01;123456;0

But when execute, not take the submitted values:

Screen Shot 2020-08-11 at 22 25 08

Check on EURUSD = OK, Check on CADJPY = OK

Thanks again & grettings;

elvinex commented 3 years ago

Hi, thank you very much for your feedback. There was indeed a NormalizeDouble() call missing in the mql4 code.

There is currently also an inconsistency in how the SL and TP are set (relative or absolute). We will soon publish an update where both, the new order and the modify function, will use relative SL and TP values.