Empty answer on logon - Python 3
Empty answer on logon - Python 3
22 Jan 2019, 16:06
Hello,
I am tryng to login on a fix server (v4.4) but i always get an empty answer
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("78.129.190.32", 5211)) s.sendall("8=FIX.4.4|9=126|35=A|49=theBroker.12345|56=CSERVER|34=1|52=20170117-08:03:04|57=TRADE|50=any_string|98=0|108=30|141=Y|553=12345|554=passw0rd!|10=131|".encode(encoding='ascii')) msg = s.recv(1024) print(msg) s.close() sys.exit()
Give me:
b''
Anyone have a solution/info ?
Replies
PanagiotisCharalampous
22 Jan 2019, 16:40
Hi touch.mjb,
Your SenderCompID (tag 49) seems wrong. Can you please check it?
Best Regards,
Panagiotis
@PanagiotisCharalampous
touch.mjb
22 Jan 2019, 16:42
RE:
Panagiotis Charalampous said:
Hi touch.mjb,
Your SenderCompID (tag 49) seems wrong. Can you please check it?
Best Regards,
Panagiotis
Hello,
The real one is "icmcapital.3002XXX" i have changed it for the example but i also get and empty answer with the true one.
thanks for your time.
@touch.mjb
PanagiotisCharalampous
22 Jan 2019, 16:44
Thanks,
Also check your password and your IP. It is better to use the hostname instead of the IP.
Best Regards,
Panagiotis
@PanagiotisCharalampous
touch.mjb
22 Jan 2019, 16:57
RE:
I tried with the domain name and change the password from cTrader to be sure its the good one and still no answer from the server, i check fom an other forum and they say if the answer is empty like that that mean the server close/refued my connection...I don't know if its true or why.
@touch.mjb
touch.mjb
22 Jan 2019, 17:00
RE: RE:
And i have tried to change the time to fracional seconds like "20190122-15:55:18.737" but still nothing.
@touch.mjb
PanagiotisCharalampous
22 Jan 2019, 17:02
Hi touch.mjb,
Is your checksum correct? how do you calculate it?
Best Regards,
Panagiotis
@PanagiotisCharalampous
touch.mjb
22 Jan 2019, 18:13
RE:
Hi,
Body = '|8=FIX.4.4|9=126|35=A|49=theBroker.12345|56=CSERVER|34=1|52=20170117-08:03:04|57=TRADE|50=any_string|98=0|108=30|141=Y|553=12345|554=passw0rd!|' CheckSum = sum([ord(i) for i in list(Body)]) % 256
@touch.mjb
touch.mjb
22 Jan 2019, 18:17
RE: RE:
touch.mjb said:
Hi,
Body = '|8=FIX.4.4|9=126|35=A|49=theBroker.12345|56=CSERVER|34=1|52=20170117-08:03:04|57=TRADE|50=any_string|98=0|108=30|141=Y|553=12345|554=passw0rd!|' CheckSum = sum([ord(i) for i in list(Body)]) % 256
and
BodyLength = str(len(Body))
@touch.mjb
touch.mjb
22 Jan 2019, 18:23
RE: RE: RE:
touch.mjb said:
touch.mjb said:
Hi,
Body = '|8=FIX.4.4|9=126|35=A|49=theBroker.12345|56=CSERVER|34=1|52=20170117-08:03:04|57=TRADE|50=any_string|98=0|108=30|141=Y|553=12345|554=passw0rd!|' CheckSum = sum([ord(i) for i in list(Body)]) % 256and
BodyLength = str(len(Body))
The thing i don't get is why i don't receive any error message ? i can telnet to the server so i know its up but can't get any answer from him do you have any bare metal-default-message i can try for logon please ?
@touch.mjb
touch.mjb
22 Jan 2019, 20:18
Its too complicated i will just use quickfixengine, but thanks for your answers !
@touch.mjb
PanagiotisCharalampous
23 Jan 2019, 09:37
Hi touch.mjb,
The problem is that I am not very familiar with Python, so I cannot check if there is anything wrong with your code. If you could use our C# example, it would be much easier to assist you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
touch.mjb
22 Jan 2019, 16:22
* s.sendall("8=FIX.4.4|9=126|35=A|49=theBroker.12345|56=CSERVER|34=1|52=20170117-08:03:04|57=TRADE|50=any_string|98=0|108=30|141=Y|553=12345|554=passw0rd!|10=131|".replace('|', chr(0x01)).encode(encoding='ascii'))
@touch.mjb