Closed krhismord closed 1 year ago
Is there any solution for this? I have the same problem. Thank you so much.
Hi, sorry for the late reply. Could you add more info? I assume it is the python version, right? In combination with MT4 or MT5? I will try to replicate the issue. If you can replicate it, could you copy the log? Thanks!
Yes, it's the python version.
The code:
p = dwx_client() p.open_order(symbol='EURUSD', order_type='buy', lots=0.01, price=0, stop_loss=1.05300, take_profit=0, magic=0, comment='', expiration=0)
When I run this code, MT4 platform open two orders at the same time. What could be the problem?
Thank you for your answer.
I could not replicate the exact issue. But I modified the code so that the file communication should have less errors.
I hope this solves the issue. Please download the new version and let me know if there is still an issue.
You should do the same with mt5 as well. It opens several positions when it shouldn't. It is not as recurrent as the MT4 one, but it would be nice if you lock the threads and make it check the ids.
On Wed, Jan 18, 2023 at 9:47 AM elvinex @.***> wrote:
I could not replicate the exact issue. But I modified the code so that the file communication should have less errors.
- Added thread locking so that two threads cannot send commands and write to files at the same time.
- Added a command ID. In MT4 it will safe the last 1000 IDs and only execute a command if the ID was not found.
I hope this solves the issue. Please download the new version and let me know if there is still an issue.
— Reply to this email directly, view it on GitHub https://github.com/darwinex/dwxconnect/issues/27#issuecomment-1387101893, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2YSYA75KAM4NDWOLG6WQE3WS7YA5ANCNFSM6AAAAAAR7L6FNI . You are receiving this because you authored the thread.Message ID: @.***>
Thanks for the info. I updated all code (python, java, dotnet, MT4, MT5). If it happens with the new code, please let me know.
Sometimes when open_order() gets triggered it places several orders at the same time. It also happens in the example.