User Comments

    5.11.2019 8:36:36

    That's great thanks   Can the market interval be changed via code?

    4.11.2019 15:22:10

    Would you mind linking the article?  I can't find it.


    30.10.2019 14:22:56

    Thanks.  Actually this explains everything :)

    With the offered prices, it has probability -  could you please tell me what this is?

    30.10.2019 12:05:50

    Yes but this prints all the bets, with no way to get just the matched lay or matched back bets.  To get the unmatched with your code is good, but the matched doesn't work this way.  Could you please show a code sample?

    30.10.2019 2:34:41

    The unmatched data works great thanks Stefan.  I really appreciate the code thanks. 

    But I still have a problem getting the matched data.  When the orders are matched, I am trying to get the combined Odds (as float) and combined Stake (as float) for Matched Lays, and Matched Backs as shown in the Market Bets window (it combines all the Matched Lays and all the Matched Backs).  All I get with the code I posted recently is the head which is the first item shown in ther market bets window, but I can't sort the map to get the requested matched/unmatched to the head.  Could you please post the code snippet for this?  

    28.10.2019 14:57:26

    So do you mean something like this?:

    let betSize(bet : Bet) =


    let getBetSize() =

     if selection.Bets |> Seq.exists (fun bet -> bet.OrderStatus <> BetOrderStatus.Matched &&   bet.BetType = BetType.Lay)
     let price =  selection.Bets |> betSize |> Seq.head

    This is the correct way?  Is there not a way to do something like selection.Bets.Size or selection.Bets.Price or selection.Bets.BetType etc?

    28.10.2019 11:26:57

    Maybe GetPriceSize is not the code I'm looking for?  When a bet is matched or partially matched, it has the Stake that is matched and the odds it is matched at.  So the code I am looking for that you have questioned is to find the stake amount that is matched.  Thanks

    28.10.2019 3:03:32

    Thanks for the info Stefan.  I am trying to use the info for a selection like this:

    let UnmatchedLayBets () =

    if _selection.Bets |> Seq.exists (fun bet -> bet.OrderStatus <> BetOrderStatus.Matched && bet.BetType = BetType.Lay)
    let price = _selection.GetPrice(BetType.Lay)
    let Stake = _selection.GetPriceSize(BetType.Lay)

    if price > 10.0

    outputMessage (sprintf "Unmatched Price > 10: %.2f " price )

    But the error exists because the result is a float option.  I have tried to find how to cast the float option to float so that I can use the result in calculations but have not found how to do it yet.  How would I return the stake and price as a float so that I can use it?  I'm sure this is an easy question for you but I have been pulling my hair out over this.

    22.10.2019 14:45:12


    When I say at +/- 2 levels, I mean the matched volume at a price (which I will use the price at +/- 2 levels because I know those prices

    22.10.2019 14:33:05

    This is the code I am using to try and find Matched Volume at levels:


    and I use it by:

    let test = getMarketDepthMatched(BetType.Lay) (MYSELECTION) 1
    outputMessage (sprintf "matched data %.2f" test)

    But this causes Bfexplorer to "hang" and I have to cancel the bot

    For my bot, the last 2 things I need is to find the matched volumes at +/- 2 levels and the Time from scheduled start, but I am having difficulty with these 2 things.   

    20.10.2019 12:54:25

    I have tried both the MyF#bot and MyC#Bot for showSelectionSP, and I tried the HorseRacingSPBotTrigger and moved showHorseData to show before inPlay the Near and Far SP, but I have never achieved to show the Near/Far Projected SP or the actual SP when inPlay (the horse metadata works).  I was wondering if there has been a change in the method to receive the SP prices?

    17.10.2019 9:13:56

    I got it to work using another of your codes that I found from weight of money :)


    17.10.2019 7:48:57

    Hi Stefan,

    Yes thanks it will get the odds at specified levels now thanks. 

    But with the volume it is different.


    On Line 35 and 27, why I can't I just substitute the "priceData.Price" with "priceData.ToBack" ?

    With the PriceGridData.GetOfferedPriceData(), there is no method (that I could find) to go to different levels like with priceGridData.GetPriceData(index)



    16.10.2019 3:13:24

    Please see the code here:

    I run it like this:

    let mutable odds = defaultArg (botTriggerParameters.GetParameter<float>("Odds")) 1.0

    odds <- getMarketDepthPrice(BetType.Back) (myLaySelection) 1
    outputMessage (sprintf "Lay Odds at Level 0 %.2f" odds)
    odds <- getMarketDepthPrice(BetType.Back) (myLaySelection) 2
    outputMessage (sprintf "Lay Odds at Level 1 %.2f" odds)

    but the result of odds is always 0.0

    I am trying to find the available odds at different market depth levels

    Could you please tell me what is wrong with the code?

    11.10.2019 11:54:39

     That is a great explanation thanks :). I have noticed 1 thing with my bot and I see it doesn't seem to do what I think it should (I'm blaming my code) so I just wanted to ask that after it performs an executeOnSelection, mySelection1 and I change status <- goToMyNextTrigger and I have another executeOnSelection mySelection2 (when new conditions are true), it can do multiple executions with different selections right?  It may be because my action happens near the end of the race but I only ever see 1 bet.

    11.10.2019 6:32:39

    I didn't explain properly sorry.  What I mean is I can see it create the bot and it has bot.Start to place the trades.  Then the next part I don't understand.  You run Update, which from what I can see only changes the parameters, so how did the bot place trades again and use the new parameters?  I can't see how it executed new trades based on what is in  the Update()

    10.10.2019 11:28:39

    I've been looking at the scalping bot and the way it creates the bots, I like it a lot.  Do you have another example of creating a bot with parameters like the scalping bot, but with a method call to execute on mySelection from within member_execute?  For example 1 method call I would have parameters and betType lay for mySelection and another method call would have different parameters for a different mySelection betType back  etc.  From your examples I am learning a lot, but I couldn't find one like this.

    5.10.2019 7:29:57

    Actually, I think I can work it out thanks, but could you please show me how to get trigger to "get" past strategy results.  Thanks

    5.10.2019 4:51:26

    Is there a way to

    match getMySelection() with
    | Some mySortedSelection -> (where mySortedSelection is a list?) 

    instead of having a lot of

     match getMySelection() with
    | Some mySelection1 ->

     match getMySelection() with
    | Some mySelection2 ->

     match getMySelection() with
    | Some mySelection3 ->........................etc


    4.10.2019 4:07:02

    Please see Your Code for Part 2 (with some additions and comments)  There is 1 thing that I cannot see in the code (line 187 - 192), and that is when a horse has improved in position, then I don't want it in mySelection.  I only want to lay it if it is in the same position or has worsened in position, (and not in top 3 which is coded on line 194).  Is it somewhere that I cannot see?