简体   繁体   English

如何访问QuickFix的通用组api?

[英]How do I access QuickFix's generic group api?

I can't find any instances of something that should be simple on the web. 我找不到网上应该简单的任何实例。

How do I define a generic group in QuickFix? 如何在QuickFix中定义通用组? I am using the Python bindings and define an MDIncrementalRefresh group like this: 我正在使用Python绑定并定义一个MDIncrementalRefresh组,如下所示:

group = fix42.MarketDataIncrementalRefresh().NoMDEntries()

But I am trying to read a group that is not standard in FIX4.2, called NoChartData . 但我试图读取一个名为NoChartData不标准的组。 As such I cannot call it because it does not exist in my FIX engine (I am putting off rebuilding QF for now -- see How to redefine QuickFix classes for custom groups? ) 因此我无法调用它,因为它在我的FIX引擎中不存在(我现在推迟重建QF - 请参阅如何为自定义组重新定义QuickFix类?

I have some idea that QF has a constructor so I can just create a generic group object and add fields to it. 我有一些想法,QF有一个构造函数,所以我可以创建一个通用的组对象并添加字段。 Does anyone know how to define groups on the fly, without rebuilding QF classes? 有没有人知道如何动态定义组,而无需重建QF类?

Thanks 谢谢

Python is not my strong suit, but this should get the idea across. Python不是我的强项,但这应该是我的想法。 You can create a new group using an arbitrary group counter field and an arbitrary group entry delimiter. 您可以使用任意组计数器字段和任意组条目分隔符创建新组。

The example you give of NoMDEntries in a MarketDataIncrementalRefresh message would have the counter field = 268 ( NoMDEntries ) and the entry delimiter = 278 ( MDEntryID ). 您在MarketDataIncrementalRefresh消息中提供NoMDEntries的示例将具有计数器字段= 268( NoMDEntries )和条目定界符= 278( MDEntryID )。 In that example, you would create the group this way: 在该示例中,您将以这种方式创建组:

group = quickfix.Group(268, 278)

To create the non-standard group you need, replace "268" with the appropriate group counter field number, and replace "278" with the appropriate entry delimiter. 要创建所需的非标准组,请将“268”替换为相应的组计数器字段编号,并将“278”替换为相应的条目分隔符。

To set the group's fields, use the following (again, as an example for MarketDataIncrementalRefresh ): 要设置组的字段,请使用以下内容(再次,作为MarketDataIncrementalRefresh的示例):

// Set the MDEntryID, which is the group entry delimiter
group.setField(quickfix.StringField(278, "id1"))

// Set the DeskID
group.setField(quickfix.StringField(284, "tradedesk1"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM