Virtual Bets (Cross Matching) Algorithm

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lopiner
    Junior Member
    • Feb 2009
    • 117

    #1

    Virtual Bets (Cross Matching) Algorithm

    Hi to all

    Even with the new feature of API-NG of returning the virtual bets i find the need to do the calculations on my own and i believe a lot of people need this too. Until now i just virtualized the first price and forgot the rest of the market depth but now Im in need of building the complete market depth and Im struggling with the code. Im most familiar with VB.Net and i will try to build it here hopefully with the collaboration of anyone that can help. If anyone tried this already please let me know. ty
    Last edited by Lopiner; 21-03-2014, 06:07 PM.
    fooledbyabet.com
  • Lopiner
    Junior Member
    • Feb 2009
    • 117

    #2
    I'm going to assume that i receive in my function a "MarketPrices" object that has the following structure:

    Code:
        
        'Market Prices Object
        Public Class MarketPrices
            Public MarketId As Integer
            Public Status As String
            Public Delay As Integer
            Public TotalSelections As Integer
            Public Selections As New List(Of SelectionDetails)
        End Class
    
        'Selection Details
        Public Class SelectionDetails
            Public SelectionId As Integer, Volume As Double, LastPrice As Double
            Public BackPrices As New List(Of PricesType)
            Public LayPrices As New List(Of PricesType)
        End Class
    
        'Prices
        Public Class PricesType
            Public Price As Double
            Public Amount As Double
        End Class
    This object can be filled with data from the old or the new API, it doesn't matter. After being filled the object is sent to the function to virtualize the bets and fill the market depth with those new prices. The function will look like this:

    Code:
        'Function to Virtualize
        Public Function VirtualizePrices(ByVal Prices As MarketPrices) As MarketPrices
    
        End Function
    The next step is the hardest one of actually building the function to create the virtual bets.
    fooledbyabet.com

    Comment

    Working...
    X