User Comments

    2.10.2019 12:38:50

    Thanks Stefan, Yes I would really appreciate if you could design the bot that works on past results, and I will endeavour to thoroughly understand the code and learn f# so that I can do this myself in the future from what you have taught and shown in this tutorial series :)

    2.10.2019 10:59:40

     Oh ok.  I sort of grabbed your code from My Staking Plan . Could you please explain the mechanism of how to run the console script and also have MyBotTrigger "get" the information from it?  And 1 other question- with my C sharp bot or my f sharp bot, would they require the console script as well for past bot results?


    2.10.2019 10:09:05

    Please see my attempt at Part 4. I added lines 75, 76, and 178 to 184.

    I basically wanted to have parameter maxLossesInRow and if the number of losses in row is less or equal to this parameter, then continue to execute bot, or else exit. Unfortunately it has some errors that hopefully can be corrected thanks?

    1.10.2019 11:48:55

    That's great to hear Stefan.  Bfexplorer truly is the best- no other software can do what Bfexplorer can.  For my non programming brain I wonder "how", but with your knowledge you always "know".  I very much look forward to the final solution :)

    1.10.2019 10:24:50

    Thanks Stefan.  I do have more understanding now, but have a long long way to go.  Thanks for your help.  With Part 4 in which the bot "counts" it's losses before shutting down, is this possible?  I question it because I see in the console bot started and bot ended, so I don't understand the mechanism of how it stores the losses if the bot ends.

    1.10.2019 10:01:51

    'F' grade for me this time.  Thanks for the solution to Part 2 :)    What homework would you like me to submit before the final reveal in Part 4? - I hope to redeem myself

    1.10.2019 8:59:15

    I am not a programmer, but this is the part 1 with the Last Price Traded added to output

    I am looking forward to viewing Stefan's code with Part 2 combined into Part 1 :)

    30.9.2019 13:51:49

    Sorry about the formatting.  I copied and pasted the working code and it looked good on my side with the correct indentations etc,, but the website changed it to the posted result that is there now.  I'll look at setting up GitHub and reposting the link to the code so others who are following/learning can view and get it.

    30.9.2019 2:52:29
    The following is the Part 1 code with the last price traded added. In Part 2, we will build triggers into this that react to our selection position change from starting point (x seconds in play) to trigger point (The number 1 and 2 position horses both have back odds less then X (and our selection is not position 1,2 or 3) module BfexplorerBot //(* #I @"C:\Program Files (x86)\BeloSoft\Bfexplorer\" #r "BeloSoft.Data.dll" #r "BeloSoft.Betfair.API.dll" #r "BeloSoft.Bfexplorer.Domain.dll" #r "BeloSoft.Bfexplorer.Trading.dll" #r "BeloSoft.Bfexplorer.Service.Core.dll" //*) open System open BeloSoft.Data open BeloSoft.Bfexplorer.Domain open BeloSoft.Bfexplorer.Trading let toIndexes (value : string) = try value.Split(',') |> Int32.Parse |> List.ofArray with | _ -> List.empty /// /// HorseRacingBotTrigger /// type HorseRacingBotTrigger(market : Market, _selection : Selection, _botName : string, botTriggerParameters : BotTriggerParameters, _myBfexplorer : IMyBfexplorer) = let allowedSelectionIndexes = toIndexes (defaultArg (botTriggerParameters.GetParameter("AllowedSelectionIndexes")) "1,2,3") let isHorseRacingMarket() = market.MarketInfo.BetEventType.Id = 7 && market.MarketDescription.MarketType = "WIN" let getActiveSelections() = market.Selections |> Seq.filter isActiveSelection |> Seq.toList let getMySelectionsData() = maybe { if allowedSelectionIndexes.Length > 0 then let selections = getActiveSelections() let mumberOfSelections = selections.Length let maximalIndex = allowedSelectionIndexes |> List.max if mumberOfSelections >= maximalIndex then return allowedSelectionIndexes |> (fun index -> selections.[index - 1]), mumberOfSelections } interface IBotTrigger with member __.Execute() = if isHorseRacingMarket() then match getMySelectionsData() with | Some (selections, mumberOfSelections) -> let mySelectionNames = selections |> (fun mySelection -> mySelection.Name) |> String.concat ", " let mySelectionBookValue = selections |> (fun mySelection -> mySelection.LastPriceTraded) |> List.sum TriggerResult.EndExecutionWithMessage (sprintf "\nMy selections: %s %f\nNumber of runners: %d" mySelectionNames mySelectionBookValue mumberOfSelections) | None -> TriggerResult.EndExecutionWithMessage "Failed to make my selections!" else TriggerResult.EndExecutionWithMessage "You can run this bot on a horse racing market only!" member __.EndExecution() = ()
    27.9.2019 23:57:23

    That is a great explanation :)

    Thanks for clearing that up for me.  

    27.9.2019 23:57:02

    After for example 20 seconds in play, I would like to check the position of the horse (using it's odds). When (if) 2 horses achieve odds less then x ( 2 for example), then re-check the position of our selection and compare it to the position it was at at 20 seconds. So if at 20 seconds, it is at position 2 and then when trigger is 2 horses are at odds below 2, it re-checks the selection and sees that it is at position 5, the selection has dropped in position.

    25.9.2019 10:33:23

    I do understand what a trigger is, I just don't underdtand how to implement it with this software so if you could explain it that would be much appreciated.  So with the example of Trigger 2 of which you have explained it as a bot, how would I now make this a trigger so as to run a different bot when this trigger is true?  Thanks

    25.9.2019 9:56:17

    Hello.  Thanks for the quick  reply.  I have noticed the support is very good and fast.  I just wanted to clarify  the Trigger  2 again.  I don't want to bet on this horse, I want to bet on amother horse when this trigger is true.  I feel that this program can definitely do it, but is it something that needs to be programmed or is there a trigger  ir some method that already does this? 

    25.9.2019 8:45:39

    I just wanted to clarify Trigger 2.  When I say any horse, I mean I'd like to use a specific horse based on current position (based on odds).  For example Trigger is when horse # 2 has odds between 1.5 and 2 (therefore obviously horse number 1 has better odds and horse number 3 has worse odds).