Incorrect format of price in NewOrderSingle message

Created at 10 May 2018, 08:28
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!
BE

beneditobvn

Joined 26.03.2018

Incorrect format of price in NewOrderSingle message
10 May 2018, 08:28


Hello guys, I need you help.

I am starting to use FIX API and I am having some problems.

When I send a Limit or Stop Order message (any message that requires the price tag (44 or 99)), it replies an error.
 

8=FIX.4.49=14435=D49=icmarkets.332781556=CSERVER57=TRADE50=332781534=252=20180510-05:11:2411=1155=154=260=20180510-05:11:2438=100040=399=1.1845110=241


8=FIX.4.49=14635=334=249=CSERVER50=TRADE52=20180510-05:11:27.56056=icmarkets.332781557=332781545=258=Incorrect data format for value371=99372=D373=610=082

It says that the format of the value price is incorrect. I am using the decimal variable in C#, the same as the exemple in GitHub. I have download the exemple and I have tested it and I have seen the same error message.

How can I fix it? What is the reason to happen it? Please, someone help me.


@beneditobvn
Replies

PanagiotisCharalampous
10 May 2018, 10:33

Hi beneditobvn,

For some reason tag 59 seems to be missing from your message. See below a correct message

8=FIX.4.4|9=14935=D|49=icmarkets.3311962|56=cServer|57=TRADE|50=3311962|34=2|52=20180510-07:25:56|11=10|55=1|54=2|60=20180510-07:25:56|38=1000|40=3|99=1.18451|59=3|10=167

Best Regards,

Panagiotis


@PanagiotisCharalampous

beneditobvn
11 May 2018, 07:09

RE: Thank you for your time, but unfortunatety it did not work.

Panagiotis Charalampous said:

Hi beneditobvn,

For some reason tag 59 seems to be missing from your message. See below a correct message

8=FIX.4.4|9=14935=D|49=icmarkets.3311962|56=cServer|57=TRADE|50=3311962|34=2|52=20180510-07:25:56|11=10|55=1|54=2|60=20180510-07:25:56|38=1000|40=3|99=1.18451|59=3|10=167

Best Regards,

Panagiotis

8=FIX.4.4|9=149|35=D|49=icmarkets.3327815|56=CSERVER|57=TRADE|50=3327815|34=2|52=20180511-03:56:16|11=11|55=1|54=1|60=20180511-03:56:16|38=1000|40=2|44=1,18951|59=3|10=223|


8=FIX.4.4|9=146|35=3|34=2|49=CSERVER|50=TRADE|52=20180511-03:56:16.267|56=icmarkets.3327815|57=3327815|45=2|58=Incorrect data format for value|371=44|372=D|373=6|10=085|

I tried to place the tag 59 with values 1, 3 and 6 and the replies were the same. I think it is not the problem because it is not required and the tag 371 of the reply has value 44. I tinhk it means that the problem is in the value of the tag 44 (the price), because of this and because I send Market Orders (do not need price) normally.

Thanks for the answer and I am waiting a new one. Please, help me.


@beneditobvn

PanagiotisCharalampous
11 May 2018, 10:30

Hi beneditobvn,

In the second message you sent, you separate the price decimals with comma. Please use dot. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

beneditobvn
12 May 2018, 08:54

RE: It is the problem

Panagiotis Charalampous said:

Hi beneditobvn,

In the second message you sent, you separate the price decimals with comma. Please use dot. 

Best Regards,

Panagiotis

I had already seen this before, but I thought that Command's Prompt from Windows showed a decimal variable with "," instead of "." because when the convert decimal to string, the number stays that way. When you said it, I changed the code of GitHub to replace "," to "." and worked. Thanks for your time and for be fast in the answers. I advise the developer to change it too in the MessageConstructor posted in GitHub. Thanks for the help again.


@beneditobvn