ejtraderLabs / ejtraderCT

The best Python Ctrader FIX API Perfect for HFT
MIT License
60 stars 20 forks source link

Not able to login #34

Open barrynorman opened 7 months ago

barrynorman commented 7 months ago

Thanks for this python package. I was wondering if someone can tell me what I'm doing wrong.

from ejtraderCT import Ctrader
import time
import logging

logging.getLogger().setLevel(logging.INFO)

SERVER="demo1.p.ctrader.com"
LOGIN="demo.purpletradingprop.12346679"
PASSWORD="XXX"
CURRENCY="USD"

api = Ctrader(server=SERVER, account=LOGIN, password=PASSWORD, currency=CURRENCY, debug=True)

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

quote = api.quote()
print(quote)

My output:

INFO:root:Market is Close or Disconnected 'NoneType' object is not callable
INFO:root:Market is Close or Logged out 'NoneType' object is not callable

Thanks for the help.

I tested also Python 3.9 but I have the same problem

github-actions[bot] commented 7 months 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 6 months ago

Thanks for this python package. I was wondering if someone can tell me what I'm doing wrong.

from ejtraderCT import Ctrader
import time
import logging

logging.getLogger().setLevel(logging.INFO)

SERVER="demo1.p.ctrader.com"
LOGIN="demo.purpletradingprop.12346679"
PASSWORD="XXX"
CURRENCY="USD"

api = Ctrader(server=SERVER, account=LOGIN, password=PASSWORD, currency=CURRENCY, debug=True)

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

quote = api.quote()
print(quote)

My output:

INFO:root:Market is Close or Disconnected 'NoneType' object is not callable
INFO:root:Market is Close or Logged out 'NoneType' object is not callable

Thanks for the help.

I tested also Python 3.9 but I have the same problem

I suggest you try testing with an IC Markets account. Sometimes, some forex brokers do not allow access to a demo account through FIX API. Check with your broker or conduct the test on IC Markets. Up until the date I used it, it worked normally on a demo account.