TheSnowGuru / PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop

Open Source Trading Strategies & End-to-End solution connecting Metatrader4 & Metatrader5 💹 with Python with a simple drag and drop EA. Fully tested bug free & efficient solution for live & paper trading⭐ Full Documentation ready. Lightweight, efficient and stable implementation 🔥
https://discord.gg/wRMUNP8ERa
653 stars 11 forks source link

Python Strategy Script Error: No connection could be made because the target machine actively refused itelf.sock #32

Closed BaseMax closed 11 months ago

BaseMax commented 1 year ago
C:\Users\Max\PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop\Strategies>python ma_cross_strategy.py
Start MT
Next...
Couldnt connect with the socket-server: [WinError 10061] No connection could be made because the target machine actively refused itelf.sock
 terminating program

C:\Users\Max\PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop\Strategies>python ma_cross_strategy.py
Start MT
Next...
Couldnt connect with the socket-server: [WinError 10061] No connection could be made because the target machine actively refused itelf.sock
 terminating program

C:\Users\Max\PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop\Strategies>python ma_cross_strategy.py
Start MT
Next...
Couldnt connect with the socket-server: [Errno 11001] getaddrinfo failedelf.sock
 terminating program

C:\Users\Max\PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop\Strategies>python ma_cross_strategy.py
Start MT
Next...
Couldnt connect with the socket-server: [WinError 10061] No connection could be made because the target machine actively refused itelf.sock
 terminating program

Source code:

# settings
timeframe = 'M1'
instrument = 'EURUSD'
# server_IP = '127.0.0.1'
# server_IP = 'locahost'
server_IP = '192.168.1.1'
server_port = 1122                                              # check port number
...

image

Experts setting: image

Branly76 commented 1 year ago

Hi,

Normally I use 127.0.0.1

afbeelding

BR

BaseMax commented 1 year ago

Thank you so much for your answer.

Branly76 commented 1 year ago

Autorization code was a request from some users as extra safety. If you fill in a code and do the same for the pytrader_API then the authorization codes are compared. Default it is None, which is also already a check. This is for upwards compatibility. So for default you have to do nothing.

If you did buy a license, the above indicator is installed in the Market folder. The EA checks if this indicator is available and checks several values within this indicator. Then the EA will be licensed, if the indicator can not be found, then it will be demo.

Branly76 commented 1 year ago

https://www.mql5.com/en/market/product/58243#