试图为betfair api调用placeOrders函数

时间:2016-04-16 09:31:00

标签: c# vb.net betfair

尝试从VB.NET代码调用placeOrders函数。 我已经将betfair网站上的C#Library转换为VB.NET。

现在在调用方法的行上它返回错误而e.data什么都没有。

enter image description here enter image description here

Friend Shared Sub testBetting()
            Try
                Dim placeInstructions As IList(Of PlaceInstruction) = New List(Of PlaceInstruction)()
                Dim placeInstruction = New PlaceInstruction()

                'get the first runner from the market
                Dim runner = marketBook(0).Runners(0)
                Dim selectionId = runner.SelectionId

                placeInstruction.Handicap = 0
                placeInstruction.Side = Side.BACK
                placeInstruction.OrderType = OrderType.LIMIT

                Dim limitOrder = New LimitOrder()
                limitOrder.PersistenceType = PersistenceType.LAPSE
                ' place a back bet at rediculous odds so it doesn't get matched 
                limitOrder.Price = 3.5
                limitOrder.Size = 0.05
                ' placing a bet below minimum stake, expecting a error in report
                placeInstruction.LimitOrder = limitOrder
                placeInstruction.SelectionId = selectionId
                placeInstructions.Add(placeInstruction)

                Dim customerRef = "785895438098" '"9876785895438098726178907895434" '"123456"
                Dim placeExecutionReport = client.placeOrders(marketID, customerRef, placeInstructions)
            Catch apiExcepion As BetfairLib.APINGException
                MessageBox.Show("Got an exception from Api-NG: " + apiExcepion.ErrorCode)
            End Try
        End Sub

0 个答案:

没有答案