Tips for Programmers
If you have some knowledge of Visual Basic scripting, particulary of VBA - the language used for creating macros in MS Office - the following tips can be useful for you.
Though all betting functions are implemented within the application, you may still want to launch betting from inside your Excel spreadsheet. This must be achieved through special functions with a pre-defined syntax. These functions exchange data with MF Pro through a DDE channel. DDE is a technology that allows two applications to interact with each other.
At the end of this page you will see the examples of both betting and cancelling procedures. You can apply these examples right away without knowing much about DDE technology. If you are interested in details please read the following paragraph.
Examples
Backing
Sub Back(marketID As Long, selectionID As Long, price As Double, amount As Double)
Dim feed As Integer
Dim data As String
feed = Application.DDEInitiate("FEEDER5", "betting")
If feed > 0 Then
data = "back/" & marketID & "/" & selectionID & "/" & price & "/" & amount
Range("AA1000") = data
Application.DDEPoke feed, "bet", Range("AA1000")
End If
End Sub
Laying
Sub Lay(marketID As Long, selectionID As Long, price As Double, amount As Double)
Dim feed As Integer
Dim data As String
feed = Application.DDEInitiate("FEEDER5", "betting")
If feed > 0 Then
data = "lay/" & marketID & "/" & selectionID & "/" & price & "/" & amount
Range("AA1000") = data
Application.DDEPoke feed, "bet", Range("AA1000")
End If
End Sub
Updating a bet addressed by its ID
Sub Update(betID As Double, newPrice As Double, newAmount As Double)
Dim feed As Integer
Dim data As String
feed = Application.DDEInitiate("FEEDER5", "betting")
If feed > 0 Then
data = "update/" & betID & "/" & newPrice & "/" & newAmount
Range("AA1000") = data
Application.DDEPoke feed, "bet", Range("AA1000")
End If
End Sub
Note: if you wish to leave either price or amount the same, you can input zero (0) instead of any of these parameters (but not both at the same time). For example:
Update 4038075284#, 0, 4
This will change only the amount of the bet.
Cancelling a bet addressed by its ID
Sub Cancel(betID As Double)
Dim feed As Integer
Dim data As String
feed = Application.DDEInitiate("FEEDER5", "betting")
If feed > 0 Then
data = "cancel/" & betID
Range("AA1000") = data
Application.DDEPoke feed, "cancel", Range("AA1000")
End If
End Sub
Cancelling a lay bet addressed by its price and amount
Sub CancelCustom(betType As String, marketID As Double, price As Double, amount As Double)
Dim feed As Integer
Dim data As String
feed = Application.DDEInitiate("FEEDER5", "betting")
If feed > 0 Then
data = betType & "/" & marketID & "/" & price & "/" & amount
Range("AA1000") = data
Application.DDEPoke feed, "cancel", Range("AA1000")
End If
End Sub
Example: CancelCustom "lay", 20520613, 2, 10

