温馨提示:本文翻译自stackoverflow.com,查看原文请点击:c# - Trying to convert string to MarketDataIncrementalRefresh
c# fix-protocol quickfix

c# - 尝试将字符串转换为MarketDataIncrementalRefresh

发布于 2021-04-14 13:21:39

我有一个文本文件FIX messages(包含所有文件和MarketDataIncrementalRefresh(类型X)),我想找到一种使用QuickFIXinC#创建MarketDataIncrementalRefresh消息的方法strings

有什么建议么?

这是一条线的示例:

1128 = 9 9 = 263 35 = X 49 = CME 34 = 10568699 52 = 20110110205433535 75 = 20110110 268 = 2 279 = 1 22 = 8 48 = 812201 83 = 1243518 107 = GEZ2 269 = 1 270 = 9825.0 271 = 153 273 = 205433000 336 = 2 346 = 14 1023 = 1 279 = 122 = 8 48 = 812201 83 = 1243519 107 = GEZ2 269 = 1270 = 9826.0 271 = 453 273 = 205433000 336 = 2 346 = 21 1023 = 3 10 = 058

查看更多

提问者
Roey Nissim
被浏览
0
Roey Nissim 2012-05-22 23:32

基本上,这是如何完成的:

string line = sr.ReadLine();
QuickFix42.MessageFactory fac = new QuickFix42.MessageFactory();
QuickFix.MsgType msgType = QuickFix.Message.identifyType(line);
QuickFix.Message message = fac.create("", msgType.getObject() as string);
message.setString(line, false);

工厂一旦给定给定的消息类型,就创建正确的消息类型,因此在这种情况下,由于类型为{X},因此QuickFix.Message消息是指向MarketDataIncrementalRefresh的指针,然后message.setString设置给定字符串中的其余道具。