ejtraderLabs / ejtraderCT

The best Python Ctrader FIX API Perfect for HFT
MIT License
61 stars 21 forks source link

STUKED WITHOUT RESPONSE #18

Closed DiMiTriFrog closed 1 year ago

DiMiTriFrog commented 1 year ago

I'm having no response when I'm running the Ctrader (from ejtraderCT import Ctrader). i tried to put a wrong password and the same... Any suggestion?

github-actions[bot] commented 1 year ago

We're glad you've opened your first issue. Please provide all the necessary details and any relevant code or screenshots to help us understand the problem better. Our team will review your issue and provide assistance as soon as possible. Thank you for contributing!

traderpedroso commented 1 year ago

I'm having no response when I'm running the Ctrader (from ejtraderCT import Ctrader). i tried to put a wrong password and the same... Any suggestion?

please share your code and log error

Mubo-412 commented 1 year ago

Same here. No Logs are provided with debug logging. Here is where it is stuck:

File "/opt/miniconda3/lib/python3.8/site-packages/ejtraderCT/api/ctrader.py", line 48, in init self.fix = FIX( File "/opt/miniconda3/lib/python3.8/site-packages/ejtraderCT/api/fix.py", line 212, in init self.qs.connect((server, 5201)) KeyboardInterrupt

DiMiTriFrog commented 1 year ago

Same here. No Logs are provided with debug logging. Here is where it is stuck:

File "/opt/miniconda3/lib/python3.8/site-packages/ejtraderCT/api/ctrader.py", line 48, in init self.fix = FIX( File "/opt/miniconda3/lib/python3.8/site-packages/ejtraderCT/api/fix.py", line 212, in init self.qs.connect((server, 5201)) KeyboardInterrupt

Right, same as you.

DiMiTriFrog commented 1 year ago

I'm using the example test:

from ejtraderCT import Ctrader server="78.129.190.32" # - Host name: (Current IP address 168.205.95.20 can be changed without notice) account="demo.icmarkets.MY_ACCOUNT" # - SenderCompID: live.icmarkets.1104926 password="MY_Pswd" # - The password you configured

api = Ctrader(server,account,password)

print(api.isconnected())

traderpedroso commented 1 year ago

Surely, it's something related to the broker's joint lock because I've just conducted tests and everything is working perfectly. Firstly, you need to change the password before copying the connection data. Usually, when you change the password, the connection data might change. Secondly, if the data provides you with a host, prefer to use the host name rather than the IP. However, if that's not the case, use the IP. Lastly, before using it, run 'pip install ejtraderCT -U'. This will ensure that you are using the latest version.

Another thing to note is that you typically need a sleep interval of 1 to 3 seconds for the connection to establish properly.

from ejtraderCT import Ctrader
import time

server="h50.p.ctrader.com" # - Host name: (Current IP address 168.205.95.20 can be changed without notice)
account="demo.icmarkets.8720721" #  - SenderCompID: demo.icmarkets.8720721
password="12345678" # - The password you configured

api = Ctrader(server,account,password)

print("Connecting")
time.sleep(3)

checkConnection = api.isconnected()
print("Is Connected?: ", checkConnection)
time.sleep(1)

api.subscribe("EURUSD", "GBPUSD")
print("Symbol Subscribed")
time.sleep(1)

for _ in range(3):
    quote = api.quote()
    print(quote)

print("disconnecting")
time.sleep(1)
api.logout()