Message length

Created at 07 Jun 2024, 13:58
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!
DU

Dussik

Joined 05.06.2024

Message length
07 Jun 2024, 13:58


Hi all!

I am generating message and calculating the length.

I using the example from the documentation and trying to generate the same message.

8=FIX.4.4|9=126|35=A|49=live.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|

as far as I know the fixed protocol - the length should be calculated from these characters

8=FIX.4.4|9=126|35=A|49=live.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|

but it's 132 characters 132

whereas the message indicates the length 126 chars

126 characters - this is this message

8=FIX.4.4|9=126|35=A|49=live.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|

 

without taking into account the separator, which is also not correct in my opinion.

Tell me how to correctly calculate the length.
Are the messages shown in the examples in the documentation correct? Because I also do not have the checksum for messages from the documentation.

 

And the last question - when testing, I send a message to the server (not this, but with the correct credentials)
But the server simply aborts the message without returning anything in response.
I have been reading this forum and have seen many posts stating that the server is responding and indicating an error. How do I get an error from the server?

 


@Dussik
Replies

PanagiotisCharalampous
08 Jun 2024, 05:59

Hi there,

It's not impossible that the example message has a mistake. The project below includes an example of this calculation and it works correctly. Have a look at it.

https://github.com/spotware/FIX-API-Sample

Regarding server response, if your message in not a well formatted fix message, you should not expect a response.

Best regards,

Panagiotis


@PanagiotisCharalampous

Dussik
09 Jun 2024, 11:37 ( Updated at: 10 Jun 2024, 05:59 )

RE: Message length

regarding the answer.
To debug, I used the reading method readln. It reads the entire line down to the character #13

That's my mistake. I fixed it and got the answer. The same problem occurred when the message was formed correctly.
I fixed this and all other issues were resolved.
Thank you

Hi there,

It's not impossible that the example message has a mistake. The project below includes an example of this calculation and it works correctly. Have a look at it.

https://github.com/spotware/FIX-API-Sample

Regarding server response, if your message in not a well formatted fix message, you should not expect a response.

Best regards,

Panagiotis

 


@Dussik

azapmodz
09 Jun 2024, 19:36 ( Updated at: 10 Jun 2024, 05:59 )

RE: Message length

Can you please respond to my question, i wrote the second most recent post on the FIX API question forum.

 


azapmodz
09 Jun 2024, 19:36 ( Updated at: 10 Jun 2024, 05:59 )

RE: Message length

Can you please respond to my question, i wrote the second most recent post on the FIX API question forum.