如何从 MarketDataIncrementalRefresh 消息中检索数据?

发布于 2024-12-07 05:14:34 字数 747 浏览 6 评论 0原文

如何从 MarketDataIncrementalRefresh 检索以下值?

  • Symbol/Instrument
  • Offer
  • Bid
  • OfferSize
  • BidSize

我熟悉 Quote 消息处理,例如:

If quote.isSetOfferPx Then Offer = quote.getOfferPx.getValue

MarketDataIncrementalRefresh 上尝试过相同的方法,但没有这样的方法,并且isSetField 始终返回 false

MarketDataIncrementalRefresh 消息示例:

8=FIX.4.29=22535=X34=349=ABC52=20110928-12:47:53.31656=TARGETCOMPID262=634528216663837491268=2279=0269=0278= 155=AUD/CAD270=1.0126515=AUD271=1000000346=1279=0269=1278=255=AUD/CAD270=1.0130715=AUD271=1000000346=110=094

How can I retrieve the following values from a MarketDataIncrementalRefresh?

  • Symbol/Instrument
  • Offer
  • Bid
  • OfferSize
  • BidSize

I'm familiar with Quote message handling, for example:

If quote.isSetOfferPx Then Offer = quote.getOfferPx.getValue

Tried the same approach on MarketDataIncrementalRefresh, but there are no such methods, and isSetField always returns false although the field does exist.

MarketDataIncrementalRefresh Example message:

8=FIX.4.29=22535=X34=349=ABC52=20110928-12:47:53.31656=TARGETCOMPID262=634528216663837491268=2279=0269=0278=155=AUD/CAD270=1.0126515=AUD271=1000000346=1279=0269=1278=255=AUD/CAD270=1.0130715=AUD271=1000000346=110=094

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巨坚强 2024-12-14 05:14:34

问题解决了。为了从 MarketDataIncrementalRefresh 检索数据,需要构建 Groups。因此,我需要获取每个组并单独检索其数据。

方法是:

Public Overrides Sub onMessage(message As QuickFix42.MarketDataIncrementalRefresh, session As SessionID)

    Try
        If message IsNot Nothing Then
            Dim group As New MarketDataIncrementalRefresh.NoMDEntries()

            For i = 1 To message.getNoMDEntries.getValue

                group = message.getGroup(i, group)

                If group.isSetSymbol Then
                    Dim l_symbol As String = group.getSymbol().getValue

                    If group.getMDEntryType().getValue() = "0"c Then
                        SetBid(l_symbol, group.getMDEntryPx().getValue())
                        If group.isSetMDEntrySize Then
                            SetBidSize(l_symbol, group.getMDEntrySize().getValue)
                        End If
                    End If

                    If group.getMDEntryType().getValue() = "1"c Then
                        SetOffer(l_symbol, group.getMDEntryPx().getValue())
                        If group.isSetMDEntrySize Then
                            SetOfferSize(l_symbol, group.getMDEntrySize().getValue)
                        End If
                    End If
                End If
            Next
        End If
    Catch ex As Exception

    End Try

End Sub

Problem solved. In order to retrieve data from MarketDataIncrementalRefresh, is build of Groups. Hence, I needed to get each group and retrieve its' data individually.

Method is:

Public Overrides Sub onMessage(message As QuickFix42.MarketDataIncrementalRefresh, session As SessionID)

    Try
        If message IsNot Nothing Then
            Dim group As New MarketDataIncrementalRefresh.NoMDEntries()

            For i = 1 To message.getNoMDEntries.getValue

                group = message.getGroup(i, group)

                If group.isSetSymbol Then
                    Dim l_symbol As String = group.getSymbol().getValue

                    If group.getMDEntryType().getValue() = "0"c Then
                        SetBid(l_symbol, group.getMDEntryPx().getValue())
                        If group.isSetMDEntrySize Then
                            SetBidSize(l_symbol, group.getMDEntrySize().getValue)
                        End If
                    End If

                    If group.getMDEntryType().getValue() = "1"c Then
                        SetOffer(l_symbol, group.getMDEntryPx().getValue())
                        If group.isSetMDEntrySize Then
                            SetOfferSize(l_symbol, group.getMDEntrySize().getValue)
                        End If
                    End If
                End If
            Next
        End If
    Catch ex As Exception

    End Try

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文