Delay in 35=8 in response to 35=D is more than 1 second. How can it be improved?
Delay in 35=8 in response to 35=D is more than 1 second. How can it be improved?
25 Jan 2019, 11:01
Hi.
I am sending NewSingleOrder 35=D type Market Order and then checking Position status by 35=AN every 100ms. Howver I get the response to this 35=8 or 35=AP after one second to know the Position ID 721=??.
In order to close the Market Order I need to know the Position ID in cTrader and if takes almost 2 seconds then the purpose of using FIX protocol is defeated. I was wondering if there is any other way to get this faster. I am using 5ms timer to send continuously 35=AN messages but it ends up going at every 100ms due to execution, platform and other delays. But I think 100ms inveraval I should get the response in terms of some ms and not in almost 2 seconds. Could you please sugget any technique by which I can improve this response time.
Here is the send/receive log messages:
35=D is sent at 00:37:20.970 with 11=1517158681.
35=AN is sent approximatly at every 100ms.
I get the 35=8 that corresponds to 11=1517158681 with 721=53892607 at time 00:37:22.466
That means delay is 1 second 496ms in receiveing 721= after sending 35=D and start cehcking with 35=AN.
Please can you suggest other efficient way to get this response faster?
-----
0 00:37:20.970 GBPUSD,M1: SendText : 8=FIX.4.4 9=147 35=D 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=859 52=20190125-08:37:20 11=1517158681 55=2 54=2 60=20190125-08:37:20 38=1000 40=1 59=1 10=223
0 00:37:20.970 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=214 35=8 34=28 49=cServer 50=TRADE 52=20190125-08:35:57.332 56=icmarkets.3421704 57=TRADE2 6=1.30905 11=1746432918 14=1000 37=91299814 38=1000 39=2 40=1 54=2 55=2 59=3 60=20190125-08:35:57.295 150=F 151=0 721=53892568 10=070
0 00:37:21.071 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=860 52=20190125-08:37:20 710=1517158681 10=115
0 00:37:21.071 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=29 49=cServer 50=TRADE 52=20190125-08:35:57.427 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=133
0 00:37:21.175 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=861 52=20190125-08:37:21 710=1517158681 10=117
0 00:37:21.175 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=30 49=cServer 50=TRADE 52=20190125-08:35:57.535 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=125
0 00:37:21.285 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=862 52=20190125-08:37:21 710=1517158681 10=118
0 00:37:21.285 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=31 49=cServer 50=TRADE 52=20190125-08:35:57.689 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=136
0 00:37:21.395 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=863 52=20190125-08:37:21 710=1517158681 10=119
0 00:37:21.395 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=32 49=cServer 50=TRADE 52=20190125-08:35:57.773 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=131
0 00:37:21.505 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=864 52=20190125-08:37:21 710=1517158681 10=120
0 00:37:21.505 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=200 35=AP 34=33 49=cServer 50=TRADE 52=20190125-08:35:57.857 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 1002=1.30934 1004=N 1005=1 1006=N 702=1 704=0 705=1000 10=184
0 00:37:21.614 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=865 52=20190125-08:37:21 710=1517158681 10=121
0 00:37:21.614 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=200 35=AP 34=34 49=cServer 50=TRADE 52=20190125-08:35:57.965 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 1002=1.30934 1004=N 1005=1 1006=N 702=1 704=0 705=1000 10=185
0 00:37:21.723 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=866 52=20190125-08:37:21 710=1517158681 10=122
0 00:37:21.723 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=200 35=AP 34=35 49=cServer 50=TRADE 52=20190125-08:35:58.068 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 1002=1.30934 1004=N 1005=1 1006=N 702=1 704=0 705=1000 10=181
0 00:37:21.824 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=867 52=20190125-08:37:21 710=1517158681 10=123
0 00:37:21.824 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=204 35=8 34=36 49=cServer 50=TRADE 52=20190125-08:36:08.329 56=icmarkets.3421704 57=TRADE2 11=1168319284 14=0 37=91299835 38=1000 39=0 40=1 54=1 55=2 59=3 60=20190125-08:36:08.285 150=0 151=1000 721=53892568 10=087
0 00:37:21.937 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=868 52=20190125-08:37:21 710=1517158681 10=124
0 00:37:21.937 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=200 35=AP 34=37 49=cServer 50=TRADE 52=20190125-08:36:08.421 56=icmarkets.3421704 57=TRADE2 55=2 710=1168319284 721=53892568 727=1 728=0 730=1.30905 1002=1.30931 1004=N 1005=1 1006=N 702=1 704=0 705=1000 10=167
0 00:37:22.046 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=869 52=20190125-08:37:21 710=1517158681 10=125
0 00:37:22.046 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=214 35=8 34=38 49=cServer 50=TRADE 52=20190125-08:36:08.554 56=icmarkets.3421704 57=TRADE2 6=1.30914 11=1168319284 14=1000 37=91299835 38=1000 39=2 40=1 54=1 55=2 59=3 60=20190125-08:36:08.513 150=F 151=0 721=53892568 10=064
0 00:37:22.147 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=870 52=20190125-08:37:22 710=1517158681 10=118
0 00:37:22.147 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=151 35=j 34=39 49=cServer 50=TRADE 52=20190125-08:36:08.555 56=icmarkets.3421704 57=TRADE2 58=POSITION_NOT_FOUND:Position not found with id 53892568 380=0 10=058
0 00:37:22.256 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=871 52=20190125-08:37:22 710=1517158681 10=119
0 00:37:22.256 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=87 35=0 34=40 49=cServer 50=TRADE 52=20190125-08:36:38.650 56=icmarkets.3421704 57=TRADE2 10=168
0 00:37:22.357 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=872 52=20190125-08:37:22 710=1517158681 10=120
0 00:37:22.357 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=87 35=0 34=41 49=cServer 50=TRADE 52=20190125-08:37:08.882 56=icmarkets.3421704 57=TRADE2 10=174
0 00:37:22.466 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=873 52=20190125-08:37:22 710=1517158681 10=121
0 00:37:22.466 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=204 35=8 34=42 49=cServer 50=TRADE 52=20190125-08:37:19.637 56=icmarkets.3421704 57=TRADE2 11=1517158681 14=0 37=91299889 38=1000 39=0 40=1 54=2 55=2 59=3 60=20190125-08:37:19.600 150=0 151=1000 721=53892607 10=087
_------------------
Replies
PanagiotisCharalampous
31 Jan 2019, 12:56
Hi netread2004.
Presonally there are not much things I can advise you regarding this since I do not know how your system works. I tested the specific message with our sample application but there is no delay. Can you try the sample application as well and let me know if you can reproduce such a delay?
Best Regards,
Panagiotis
@PanagiotisCharalampous
netread2004
31 Jan 2019, 13:45
I used sample application code in my program after removing GUI part of it and made it automatic. My system works automatically, that is, it keeps sendinding 35=D and keep checking for 721=?? in 35=AP by sending 35=AN. I am sending these FIX messages using same code as in your sample application I just removed GUI part of it and made it automatic.
This can not be reproduced in sample application becasue sample application is manual application through GUI.
I don't think you can reproduce this by sending just one message through GUI.
This is what happens - when I send very first 35=AN message after 35=D for market order you might see the response very fast and I could see that with this example. It is in few hundred milliseconds, But, as I keep sending automatically more and more 35=D, the response get slower and slower. Since this program I am using for sending messages automatically after say 10 such 35=D message responses get delayed more and more and delay become in the magnitide more than 10 seconds. I can plot a graph on this I can send you.
So, this is real issue and I don't think you can reproduce with sample application you have just by clicking buttons manually. This must be reproduced by running program automatically and obsverve the delay in respone to 35=AN that gets accumulated as number of 35=D increase.
Please can you comment on the general method I am using to get 721=*** for my market order? Is it valid way of doing it or is there any tag I should use to get these messages? I would appreciate if you could comment on this.
Thanks
@netread2004
PanagiotisCharalampous
31 Jan 2019, 14:36
Hi netread2004,
There is no other way to get open positions than 35=N. Is there a reason to send the message every 100 ms if you have not sent an order?
Best Regards,
Panagiotis
@PanagiotisCharalampous
netread2004
31 Jan 2019, 14:52
I send an order first and then send 35=AN to get 35=AP for corresponding CLOrderID to find out 721=???.
Here is the squence of FIX messages
1. 35=D with certain ClOrderID -- to place market order.
2. I send 35=AN to request position status and I look for 35=AP for the same ClOrdID (that is 710==) to get 721=??
3. I repeat step 2 until I get 35=AP for corresponding ClOrdID to get 721=?? value.
I repeat step 2 every 100ms so that I can get the response 35=AP fast. It is part of Listener process.
Does this make any sense?
@netread2004
PanagiotisCharalampous
31 Jan 2019, 15:02
Hi netread2004,
No it doesn't make sense. You should send 35=AN once and wait for the response. The way you do it, you are probably spamming the server hence the delay. The server will need to respond to all your requests.
Best Regards,
Panagiotis
@PanagiotisCharalampous
netread2004
31 Jan 2019, 15:18
Ok. Let me understand this first.
Following is the part of code for sending 35=AN from your Sample Application:
---------------------------
private void RequestForPositions(string posID)
{
ClearText();
var message = _messageConstructor.RequestForPositions(MessageConstructor.SessionQualifier.TRADE, _messageSequenceNumberT, posID);
_testRequestID++;
txtMessageSend_Text = message;
txtMessageReceived_Text = SendTradeMessage(message);
if (printWholeFixMsg)
printSendReceive();
if (deCryptEn)
deCryptMessage(txtMessageSend_Text, txtMessageReceived_Text);
}
--------------------
When I call RequestForPositions(ClOrdID) the message 35=AN ( string varaible message in above code) is sent to server and also it receives some response which is read in variable txtMessageReceived_Text from server .
I have just added print option and decode option "deCryptEn" to this code otherwise this is same code as it is in Sample Application.
When I send 35=AN using above routine I receve some message back from server and it is NOT neccessarily 35=AP at all. If I dont receive 35=AP then I am not going to receive this If I don't send another 35=AN and that is the reason I send it repeatedly until I get 35=AP for corresponding ClOrID.
How do I get 35=AP without sending any message? If I am just sending 35=AN once and wait for 35=AP without sending any new message how am I going ot get it? I think there is some issue here in my basic understanding and I trying to understand fully.
Please through some light on this. I would greatly appreciate.
@netread2004
PanagiotisCharalampous
31 Jan 2019, 15:38
Hi netread2004,
After sending 35=D, you should wait for 35=8 (Execution Report). After the execution report, you should send the message for the positions (35=AN) and receive 35=AP.
Best Regards,
Panagiotis
@PanagiotisCharalampous
netread2004
31 Jan 2019, 15:58
That is what exactly I did.
Here is the part of messages that I have attached in the begingin of this thread.
Message 1 ---- 0 00:37:20.970 GBPUSD,M1: SendText : 8=FIX.4.4 9=147 35=D 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=859 52=20190125-08:37:20 11=1517158681 55=2 54=2 60=20190125-08:37:20 38=1000 40=1 59=1 10=223
The above message is 35=D that I sent with ClOrdID 11=1517158681 . I received the following message in response to above message:
Message 2 --- 0 00:37:20.970 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=214 35=8 34=28 49=cServer 50=TRADE 52=20190125-08:35:57.332 56=icmarkets.3421704 57=TRADE2 6=1.30905 11=1746432918 14=1000 37=91299814 38=1000 39=2 40=1 54=2 55=2 59=3 60=20190125-08:35:57.295 150=F 151=0 721=53892568 10=070
The above message 35=8 I received in response to 35=D I sent. As you can see this 35=8 does NOT correspond to 11=1517158681 the original 35=D clOrdID. So, as you suggested I received 35=8 and then I sent 35=AN for the same ClOrdID (710=1517158681) as it was sent in first 35=D message. 35=AN is as follows:
Message 3 --- 0 00:37:21.071 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=860 52=20190125-08:37:20 710=1517158681 10=115
Following is the message received in response to 35=AN with ClOrdID 710=1517158681. Following is 35=AP but it is not for ClOrdID 710=1517158681. Following 35=AP is for some other ClOrdID 710=1746432918 that means 721 is not corresponding to market order sent in 35=D with ClOrdrID 11=1746432918.
Message 4 --- 0 00:37:21.071 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=29 49=cServer 50=TRADE 52=20190125-08:35:57.427 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=133
Now, I did not receive 35=AP corresponding to ClOrdID 710=1746432918 and therefore I sent another 35=AN and received 35=AP but as you can see from the sequence of messages in the begining of this thread this 35=AP does not correspond to ClOrdID 710=1746432918; therefore I have to send 35=AN repeatedly until I get either 35=8 or 35=AP that corresponds to original ClOrdID 1746432918. AS you can see it took so many messages to get the the correct 721 correspond to the ClOrID 1746432918. the last message is as follows:
0 00:37:22.466 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=204 35=8 34=42 49=cServer 50=TRADE 52=20190125-08:37:19.637 56=icmarkets.3421704 57=TRADE2 11=1517158681 14=0 37=91299889 38=1000 39=0 40=1 54=2 55=2 59=3 60=20190125-08:37:19.600 150=0 151=1000 721=53892607 10=087
The correct 721 is 53892607 and other 721 I received in other messages are not the correct 721 values.
Does this clarify why I am sending multiple 35=AN message? Please let me know.
@netread2004
netread2004
31 Jan 2019, 16:02
RE:
netread2004 said:
That is what exactly I did.
Here is the part of messages that I have attached in the begingin of this thread.
Message 1 ---- 0 00:37:20.970 GBPUSD,M1: SendText : 8=FIX.4.4 9=147 35=D 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=859 52=20190125-08:37:20 11=1517158681 55=2 54=2 60=20190125-08:37:20 38=1000 40=1 59=1 10=223
The above message is 35=D that I sent with ClOrdID 11=1517158681 . I received the following message in response to above message:
Message 2 --- 0 00:37:20.970 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=214 35=8 34=28 49=cServer 50=TRADE 52=20190125-08:35:57.332 56=icmarkets.3421704 57=TRADE2 6=1.30905 11=1746432918 14=1000 37=91299814 38=1000 39=2 40=1 54=2 55=2 59=3 60=20190125-08:35:57.295 150=F 151=0 721=53892568 10=070
The above message 35=8 I received in response to 35=D I sent. As you can see this 35=8 does NOT correspond to 11=1517158681 the original 35=D clOrdID. So, as you suggested I received 35=8 and then I sent 35=AN for the same ClOrdID (710=1517158681) as it was sent in first 35=D message. 35=AN is as follows:
Message 3 --- 0 00:37:21.071 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=860 52=20190125-08:37:20 710=1517158681 10=115
Following is the message received in response to 35=AN with ClOrdID 710=1517158681. Following is 35=AP but it is not for ClOrdID 710=1517158681. Following 35=AP is for some other ClOrdID 710=1746432918 that means 721 is not corresponding to market order sent in 35=D with ClOrdrID 11=1746432918.
Message 4 --- 0 00:37:21.071 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=29 49=cServer 50=TRADE 52=20190125-08:35:57.427 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=133
Now, I did not receive 35=AP corresponding to ClOrdID 710=1746432918 and therefore I sent another 35=AN and received 35=AP but as you can see from the sequence of messages in the begining of this thread this 35=AP does not correspond to ClOrdID 710=1746432918; therefore I have to send 35=AN repeatedly until I get either 35=8 or 35=AP that corresponds to original ClOrdID 1746432918. AS you can see it took so many messages to get the the correct 721 correspond to the ClOrID 1746432918. the last message is as follows:
0 00:37:22.466 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=204 35=8 34=42 49=cServer 50=TRADE 52=20190125-08:37:19.637 56=icmarkets.3421704 57=TRADE2 11=1517158681 14=0 37=91299889 38=1000 39=0 40=1 54=2 55=2 59=3 60=20190125-08:37:19.600 150=0 151=1000 721=53892607 10=087
The correct 721 is 53892607 and other 721 I received in other messages are not the correct 721 values.
Does this clarify why I am sending multiple 35=AN message? Please let me know.
correction in part of above message instead of "order sent in 35=D with ClOrdrID 11=1746432918." please read it as "order sent in 35=D with ClOrdrID 11=1517158681."
@netread2004
netread2004
31 Jan 2019, 16:11
Sorry for the typo in ClOrdID in several places. Here is the correct message:
That is what exactly I did.
Here is the part of messages that I have attached in the begingin of this thread.
Message 1 ---- 0 00:37:20.970 GBPUSD,M1: SendText : 8=FIX.4.4 9=147 35=D 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=859 52=20190125-08:37:20 11=1517158681 55=2 54=2 60=20190125-08:37:20 38=1000 40=1 59=1 10=223
The above message is 35=D that I sent with ClOrdID 11=1517158681 . I received the following message in response to above message:
Message 2 --- 0 00:37:20.970 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=214 35=8 34=28 49=cServer 50=TRADE 52=20190125-08:35:57.332 56=icmarkets.3421704 57=TRADE2 6=1.30905 11=1746432918 14=1000 37=91299814 38=1000 39=2 40=1 54=2 55=2 59=3 60=20190125-08:35:57.295 150=F 151=0 721=53892568 10=070
The above message 35=8 I received in response to 35=D I sent. As you can see this 35=8 does NOT correspond to 11=1517158681 the original 35=D clOrdID. So, as you suggested I received 35=8 and then I sent 35=AN for the same ClOrdID (710=1517158681) as it was sent in first 35=D message. 35=AN is as follows:
Message 3 --- 0 00:37:21.071 GBPUSD,M1: SendText : 8=FIX.4.4 9=100 35=AN 49=icmarkets.3421704 56=cServer 57=TRADE 50=TRADE2 34=860 52=20190125-08:37:20 710=1517158681 10=115
Following is the message received in response to 35=AN with ClOrdID 710=1517158681. Following is 35=AP but it is not for ClOrdID 710=1517158681. Following 35=AP is for some other ClOrdID 710=1746432918 that means 721 is not corresponding to market order sent in 35=D with ClOrdrID 11=1746432918.
Message 4 --- 0 00:37:21.071 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=166 35=AP 34=29 49=cServer 50=TRADE 52=20190125-08:35:57.427 56=icmarkets.3421704 57=TRADE2 55=2 710=1746432918 721=53892568 727=1 728=0 730=1.30905 702=1 704=0 705=1000 10=133
Now, I did not receive 35=AP corresponding to ClOrdID 710=1517158681 and therefore I sent another 35=AN and received 35=AP but as you can see from the sequence of messages in the begining of this thread this 35=AP does not correspond to ClOrdID 710=1517158681; therefore I have to send 35=AN repeatedly until I get either 35=8 or 35=AP that corresponds to original ClOrdID 1517158681. AS you can see it took so many messages to get the the correct 721 correspond to the ClOrID 1517158681. the last message in this case 35=8 is as follows:
0 00:37:22.466 GBPUSD,M1: ReceivedText : 8=FIX.4.4 9=204 35=8 34=42 49=cServer 50=TRADE 52=20190125-08:37:19.637 56=icmarkets.3421704 57=TRADE2 11=1517158681 14=0 37=91299889 38=1000 39=0 40=1 54=2 55=2 59=3 60=20190125-08:37:19.600 150=0 151=1000 721=53892607 10=087
The correct 721 is 53892607 and other 721 I received in other messages are not the correct 721 values.
Does this clarify why I am sending multiple 35=AN message? Please let me know.
@netread2004
PanagiotisCharalampous
31 Jan 2019, 17:24
Hi netread2004,
If you are sending a message with a ClOrdID (1517158681) but you receive a response with another ClOrdID (1746432918) then probably the server is still responding to messages sent before (1746432918 must have been sent before 1517158681). So you need to wait until 35=8 arrives for 1517158681 instead of sending additional messages which will cause more displacement and confusion. It seems that you assume that each message that arrives is a response to the previous message sent which is not the case. This is why tag 11 exists, to distinguish for which message the response corresponds to. If the ClOrdID of a response does not match to the ClOrdID of a request then it is not a response to that request. I believe you need to tidy up a bit the way you send and receive messages instead of sending additional messages until you get what you want. You must not assume that you will receive a response before you send the next message and some responses might come after you have sent several messages. Therefore you will need to match responses to previous requests. However, whatever I say is hypothetical since I do not know what the code is actually doing.
Best Regards,
Panagiotis
@PanagiotisCharalampous
netread2004
31 Jan 2019, 17:49
I totally agree with you on what you said "If you are sending a message with a ClOrdID (1517158681) but you receive a response with another ClOrdID (1746432918) then probably the server is still responding to messages sent before (1746432918 must have been sent before 1517158681). "
Having said this can you tell me what you mean by "wait until 35=8 arrives for 1517158681"?
Looks like there is some way to know what message I am receiving without sending any additional message to server from my computer.
That is server will , on its own, start sending messages and somehow I have to look for what message server is sending.
Is there any method by which I can receive message from server without sending any message to server?
As I can see from the code from Sample application following call is the only way to receive message from server:
txtMessageReceived_Text = SendTradeMessage(message);
But in order to receive message from server I have to send some "message" using above function call
I don't see any method that will help me in waiting for receiving the required message without sending QUERY message to server.
Can you tell me how I can "wait until 35=8 arrives for 1517158681"?
@netread2004
PanagiotisCharalampous
31 Jan 2019, 18:00
Hi netread2004,
First of all you should not use the sample application as a design pattern to build your own. The example application only serves the purpose of demonstrating how to construct, send and receive FIX messages. It is not a FIX engine. Essentially, you should have a listener function that should always listen to messages arriving from the server e.g. read data from the connection every 100 ms. This way your listener will be intependent of your message sending functions. Maybe you would like to have a look at the Open API sample application that follows such a design.
Best Regards,
Panagiotis
@PanagiotisCharalampous
netread2004
01 Feb 2019, 06:16
Thank you very much for your help in getting very good insight in working of FIX message.
@netread2004
netread2004
25 Jan 2019, 11:23
To add one thing to this is - I observed that as time passes this delay gets worse as more and more FIX mesages are sent to place Market orders and in one case I see that I recevied 721= value after 15 seconds. Am I doing something wrong here?
Please comment on this.
Thanks
@netread2004