ejtraderLabs / ejtraderCT

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

FXPRO Not Connecting #11

Closed Dexter10X closed 1 year ago

Dexter10X commented 1 year ago

Hello!

I am trying to connect to my Demo FxPro account.

Settings in python file as follows

server = "h8.p.c-trader.cn" # Host name broker = "fxpro" account = "10552478" password = "xxxxxx-xxxxxx-xxxxxx" currency = "EUR"

Returning the following Error

ERROR:root:Logged out: RET_INVALID_DATA ERROR:root:Disconnected ERROR:root:Logged out: RET_INVALID_DATA ERROR:root:Disconnected

Could you please take a look at this and let me know what I am doing wrong?

Thanks!

traderpedroso commented 1 year ago

Hello!

I am trying to connect to my Demo FxPro account.

Settings in python file as follows

server = "h8.p.c-trader.cn" # Host name broker = "fxpro" account = "10552478" password = "xxxxxx-xxxxxx-xxxxxx" currency = "EUR"

Returning the following Error

ERROR:root:Logged out: RET_INVALID_DATA ERROR:root:Disconnected ERROR:root:Logged out: RET_INVALID_DATA ERROR:root:Disconnected

Could you please take a look at this and let me know what I am doing wrong?

Thanks!

Can you paste the trade and quote data from your cTrader API here? I've never used FxPro, just the data you received from setting up the API. This error is usually caused by not changing the password before copying the data from the API, as it changes every time you set a new password.

Dexter10X commented 1 year ago

Hello!

Please see copy and paste trade and quote data below

Host name (Current IP address 176.58.118.184 can be changed without notice) Port: 5211 (SSL), 5201 (Plain text). Password: (a/c 10552478 password) SenderCompID: demo.fxpro.10552478 TargetCompID: cServer SenderSubID: QUOTE

Host name (Current IP address 176.58.118.184 can be changed without notice) Port: 5212 (SSL), 5202 (Plain text). Password: (a/c 10552478 password) SenderCompID: demo.fxpro.10552478 TargetCompID: cServer SenderSubID: TRADE

Thanks!

traderpedroso commented 1 year ago

Hello!

Please see copy and paste trade and quote data below

Host name (Current IP address 176.58.118.184 can be changed without notice) Port: 5211 (SSL), 5201 (Plain text). Password: (a/c 10552478 password) SenderCompID: demo.fxpro.10552478 TargetCompID: cServer SenderSubID: QUOTE

Host name (Current IP address 176.58.118.184 can be changed without notice) Port: 5212 (SSL), 5202 (Plain text). Password: (a/c 10552478 password) SenderCompID: demo.fxpro.10552478 TargetCompID: cServer SenderSubID: TRADE

Thanks!

Based on the information you provided, here is the connection attempt: try with currency="USD" as well. Sometimes, from one broker to another, it doesn't work with EUR or USD. Test both and make sure to change the password first, then copy the part that is listed as SenderSubID: TRADE. Perform the tests and let me know. Unfortunately, I'm a bit busy to open an account with FXPro at the moment.

from ejtraderCT import Ctrader

import time
import logging
from datetime import datetime

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

server="176.58.118.184" # Host name
broker="fxpro" 
account="10552478"
password="the pass you set on setting api "
currency="EUR" # try also with USD 

api = Ctrader(server,broker,account,password,currency)
Dexter10X commented 1 year ago

Thank you for the quick reply!

I could not get the demo account to connect on FXPro but did manage to the get the live account to connect.

Appreciate the help!

traderpedroso commented 1 year ago

Thank you for the quick reply!

I could not get the demo account to connect on FXPro but did manage to the get the live account to connect.

Appreciate the help! I suggest using IC Markets. It works normally on demo accounts and has the best cost."