开发者

How to retrieve data from MarketDataIncrementalRefresh message?

开发者 https://www.devze.com 2023-04-09 19:03 出处:网络
How can I retrieve the following values from a MarketDataIncrementalRefresh? Symbol/Instrument Offer Bid

How can I retrieve the following values from a MarketDataIncrementalRefresh?

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

I'm familiar with Quote message handling, fo开发者_开发知识库r 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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消