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

[RESOLVED] Ubuntu + Python+ Wine + MT4 + dwx-zeromq-connector #46

Closed TheChapus closed 4 years ago

TheChapus commented 4 years ago

Hello,

I am writing to tell you that I am happily using your in Linux development :D

I am currently using this function to ask for open orders and perform a moviemto of SL if applicable, but I have found it difficult to have the dictionary that returns printed on the whole screen, which is not useful for debugging the code since the I am storing in a variable.

I enclose function that I use.

def alarma():
    try:
        while 1:
            _zmq._DWX_MTX_GET_ALL_OPEN_TRADES_()
            orden_open = _zmq._thread_data_output#Capturamos rps

            if(orden_open==None):
                pass
            else:
                 print("Ordenes Abiertas:",len(orden_open['_trades'].keys()))
                 time.sleep(6)

    except Exception as e:
        print("Error al obtener toda la data: ",e)

Could you tell me what should I do so that this is not done?

Congratulations again

cpfxcl commented 4 years ago

Hi, I have already solved it :D

integracore2 commented 4 years ago

Hi @TheChapus ,

Great to hear you're successfully using the project in a Linux environment - well done! 🙂

In the code you've pasted, I would introduce a short sleep delay after the call to _zmq._DWX_MTX_GET_ALL_OPEN_TRADES_() as the response from MetaTrader is best expected with at least 10-15 milliseconds worth of a delay.

Hope this helps!

badgeek commented 4 years ago

hi @TheChapus how do you make this work on wine? i cant get dwx EA to work on metatrader ( :( icon showed)

cpfxcl commented 4 years ago

Hi @badgeek , what doesn't work for you? What have you tried to do? Can you upload a picture of the error?

badgeek commented 4 years ago

@cpfxcl im just installing it on mt4 inside wine, and The ea does not give status that it sending market data (it shows on vmware)

integracore2 commented 4 years ago

im just installing it on mt4 inside wine, and The ea does not give status that it sending market data (it shows on vmware)

@badgeek - the :( icon indicates that you have not enabled live trading in either the terminal or the EA Inputs (or possibly both).

Please watch this video in its entirety for troubleshooting assistance: https://www.youtube.com/watch?v=7aAsFZ_r5zU

Hope this helps!

badgeek commented 4 years ago

@integracore2 @cpfxcl i did autotrade and now got :) icon, but still zmq connector not working, screenshot is same like https://github.com/darwinex/dwx-zeromq-connector/issues/4, zmq conn should output more into the log

TheChapus commented 4 years ago

You can open MetaEditor and press the compile button in your code? And send the result, this can lead us to find the error.

badgeek commented 4 years ago

@TheChapus its compiled just fine

screenshot_1028

i think this is related to https://github.com/dingmaotu/mql-zmq/issues/15

someone also mentioned about the absence of winbind in osx high sierra +

badgeek commented 4 years ago

i tested on crossover and playonmac and also not working

cpfxcl commented 4 years ago

And if you try it in a MV?

badgeek commented 4 years ago

@cpfxcl what is MV ?

badgeek commented 4 years ago

its working on vm but would be good if its also work on wine

TheChapus commented 4 years ago

are you your vm what operating system do you have?

I've tried it with Ubuntu 18.04

badgeek commented 4 years ago

@TheChapus im not on vm, the problem is running it on osx with wine, i have it working in VM environment in windows 7, its just really cool when i can run it without VM

TheChapus commented 4 years ago

Great, have to continue "playing" with the "code"

Deeptradingfx commented 4 years ago

Great, have to continue "playing" with the "code"

im doing tests for more than 2 years now but doesn't work! I did also try it with SMBUp! I noticed the sockets in general do not work, and winhttp doesn't work either! the only work around was the parallels desktop how ever zeromq on python doing great on macOS