Can't login for a TRADE session

Created at 02 Nov 2021, 22:10
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
SW

swapd0

Joined 07.10.2019

Can't login for a TRADE session
02 Nov 2021, 22:10


I'm coding a FIX API in C++, I have a connection for QUOTE session and it works but I can't login for a TRADE session.

This is my login message:

8=FIX.4.4|9=126|35=A|49=live.icmarkets.***|56=CSERVER|57=TRADE|34=1|52=20211102-18:59:47.000|98=0|141=Y|108=30|553=***|554=***|10=206|

Then I get this error message.

58=TargetSubID is assigned with the unexpected value 'TRADE', expected 'QUOTE'10=228Login error: TargetSubID is assigned with the unexpected value 'TRADE', expected 'QUOTE'

Error: TargetSubID is assigned with the unexpected value 'TRADE', expected 'QUOTE'

If I remove the 108 field in the login message I get this. What I'm sending:

8=FIX.4.4|9=119|35=A|49=live.icmarkets.***|56=CSERVER|57=TRADE|34=1|52=20211102-19:06:07.000|98=0|141=Y|553=***|554=***|10=139|

What I get:

58=Invalid Logon message: Required tag missing, field=10810=049Login error: Invalid Logon message: Required tag missing, field=108

Error: Invalid Logon message: Required tag missing, field=108

 

Looking at the FIX API pdf the logon message has a 108 field, what I'm doing wrong?

 

 

 


@swapd0
Replies

PanagiotisCharalampous
03 Nov 2021, 08:07

Hi swapd0,

Can you check if you can reproduce this problem using FIX API Sample? If you can connect using the sample, then compare the messages to find what is different.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

amusleh
03 Nov 2021, 08:18

Hi,

Field 108 is for heart beat interval and its required, here is a valid logon message that I just tested:

8=FIX.4.4|9=195|35=A|49=demo.ctrader.***|34=1|56=cServer|57=TRADE|50=TRADE|52=20211103-06:04:54.485|98=0|108=30|141=Y|553=***|554=***|10=026|

Are you sure you are connected to Trade end point? please check the host and port, maybe you are using Quotes port instead of Trade port.


@amusleh

swapd0
03 Nov 2021, 09:42

RE:

PanagiotisCharalampous said:

Hi swapd0,

Can you check if you can reproduce this problem using FIX API Sample? If you can connect using the sample, then compare the messages to find what is different.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

I can't test it with FIX API Sample because I have a Mac.


@swapd0

swapd0
03 Nov 2021, 10:14 ( Updated at: 03 Nov 2021, 10:23 )

RE:

amusleh said:

Hi,

Field 108 is for heart beat interval and its required, here is a valid logon message that I just tested:

8=FIX.4.4|9=195|35=A|49=demo.ctrader.***|34=1|56=cServer|57=TRADE|50=TRADE|52=20211103-06:04:54.485|98=0|108=30|141=Y|553=***|554=***|10=026|

Are you sure you are connected to Trade end point? please check the host and port, maybe you are using Quotes port instead of Trade port.

This!

Thanks Amusleh

Although now I have this error. Is weird because I generate the timestamp with the same function and it works for a quote session.

Error: Invalid Logon message: SendingTime accuracy problem, field=52

 

Edited:

Ok, I'm sending messages with the time 7:15:xxx, the server responds with time 8:15:xx, although I've 9:15:xx on my computer.


@swapd0

amusleh
03 Nov 2021, 15:25

RE: RE:

swapd0 said:

PanagiotisCharalampous said:

Hi swapd0,

Can you check if you can reproduce this problem using FIX API Sample? If you can connect using the sample, then compare the messages to find what is different.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

I can't test it with FIX API Sample because I have a Mac.

Hi,

You can use these samples on Mac: spotware/quickfixnsamples.net: .NET Samples for QuickFIXn library and Spotware FIX API (github.com)


@amusleh