Article

Bfexplorer - Your Guide to Betting Smarter

This week I exchanged couple of emails with betfair Australia BDP team, and as this discussion could be interesting for others here are some questions.

BDP team: “While some of the tutorials on our automation site may not be necessarily profitable as currently offered, the main focus that we have around these tutorials is to provide a starting point for punters who may not have experience in automation or may still rely solely on the Betfair website. The tutorials that are provided are intended as a starting point where they can then move on to develop some of the techniques used into their own profitable strategies.”

Bfexplorer features are presented on this web page:

http://bfexplorer.net/Products/ProductFeatures

So in three groups there are presented main program features in the user interface, trading tools and betfair bot automation.

Anyone having problems to understand some features should go through this short tutorial, or the best way is to browse forum looking for exact case studies of using bfexplorer app features in posts tagged by “Case Study”. All posts tagged by “Case Study” show how bfexplorer app solves problems other betfair api programs have problems to solve, every post has link to other vendor post, so anyone can compare bfexplorer solution of the problem to the other betfair app one:

 http://bfexplorer.net/Articles/ByTag?tag=Case Study

BDP team: “I just wanted to check one thing with you, in a couple of blog posts, you’ve provided .fsx file code which can be placed within Bfexplorer directory. Just wanted to confirm that Bfexplorer supports code based automation strategies that can be custom made and imported into your program? (An example I found was this: https://gist.github.com/StefanBelo/3baa73a8a33adb5147fecd4d75bf22ed)

If so, this is a very interesting feature and may be a great option for advanced automation punters considering making the jump from third party tools to creating a custom bot via our API. What language does this feature support?”

Any betfair user knows what is back bet and what is lay bet placed on betfair exchange. The only “automation” betfair web page user is offered by betfair is “cash out feature”, so possibility to hedge bet position for equal profit or loss. Betfair named this feature “cash out”, because you cash/take out your remaining bet liability from exchange, well the official marketing explanation is:

“Cash Out is a revolutionary feature from Betfair that puts the power in your hands. With Cash Out, you can lock in a profit or cut your losses during a match, race or event. No longer do you have to wait until it’s finished to take your winnings. Betfair crunch the live market numbers in real-time to give you the value of your In-Play bets. Simply hit the yellow button when you want to Cash Out. With Betfair, you decide.”

Betfair offers api so it allows to create different kind of programs for betfair user, and all these programs offer better features for its users than betfair wb page only.

Bfexplorer app offers prebuilt bot strategies which extend betfair web page features, and could be divided to two groups. Those bots placing bets and bots (small programs) making automation easier.

The first group of bots is following:

Place Bet

Place SP Bet

Place Dutching Bets

Be the First in Queue

Fill or Kill

Close Selection Bet Position

Close Selection Bet Position at Odds

Place Bet and Close Selection Bet Position

Tick Offset

Scratch Trading

Trailing Stop Loss

Trailing Stop Loss on Market

Now, from my naming convention, are you able to judge which bot strategies are “cash out” ones? (My hint: there are 7 bot strategies in bfexplorer automation arsenal.)

The second group of bots is following:

Execute on Selections

Execute Bots

Execute on Associated Market

Execute Till Target Profit

If Then Else

Sequence Execution

Concurrent Execution

Repeat Until

Execute Trigger Bot

Football Bot

Tennis Bot

Stop Bots and Cancel Bets

Cancel Bots on Selection

Execute at Time

These 14 different bot strategies allow a common user to build bot strategies just by setting parameters, so without programming VBA Excel script or setting up formulas.

For instance, you are bettor placing bets with big amount on horse racing market, 10 minutes before the official race start time.

If you want to automate this bet placing using “Strategy / Bot Executor for Selections” tool, then you would create your bot settings using “Place Bet” bot and start your bet placing on selected horses automatically.

But if your bet amount is really high, for instance 2000 GBP then placing such big bet will definitely influence odds on this horse, so if you want to place your bets in small parts for instance for 200 GBP, then you can create such strategy using bot: “Repeat Until” where for BotName parameter you set your “Place Bet” bot settings, for instance “Back 200 GBP”, RepeatUntilParameter to Number Of Iterations, TargetValue to 10, and NextIterationTimeout to 0:00:10.

If your bot settings: “Back 200 GBP” is set to offer your bet, then above described strategy will offer your 200 GBP bet and waits till is fully matched, if odds changes then your unmatched part of the back bet is updated to the new best offered price/odds when of course offered price/odds is in set allowed price/odds range (set by parameters: MinimumOdds, MaximumOdds, PlaceBetInAllowedOddsRange).

When entire back bet amount is matched “Repeat Until” bot will wait 10 seconds and repeat execution of your “Back 200 GBP” again, so totally 10 times set by parameter: TargetValue.

I think now you understand why I call such strategy settings the bot. Well because bot is small program automating specific task.

Bfexplorer offers BOT SDK, SDK means software development kit, so it is set of libraries that can be used by software developers to quickly build end product, on already built and tested code. So developers do not have to build their own code to interact with betfair api, and BOT SDK offers examples of using such code:

http://bfexplorer.net/Products/BfexplorerBotSDK

https://github.com/StefanBelo/Bfexplorer-BOT-SDK

one of such examples is code to build bot strategies that could be directly integrated into  bfexplorer app:

https://github.com/StefanBelo/Bfexplorer-BOT-SDK/tree/master/MyCsharpBot

In BOT SDK I show examples in C# or F# programming languages but as any .net programming language can be used, for instance Visual Basic as well.

I myself use BOT SDK to create my own bot strategies, for instance your Machine Learning strategies were integrated this way to bfexplorer:

http://bfexplorer.net/Community/BlogContent/434

The simpler way to create bot trigger strategy is to create bot trigger script:

https://gist.github.com/StefanBelo

I use it myself when testing some ideas, and when the idea shows some potential profitability, I build full bot strategy from it.

For now there is only F# support for such bot trigger script, if you want to uses bot trigger script without compiline it to .net assembly, in such case, of course the trigger code is automatically build and injected to bfexplorer app.

Because the bot trigger implements IBotTrigger interface any software developer can create such bot trigger script in any .net programming language and build such script to .net assembly, such assembly can be executed using the “Execute Trigger Bot”.

Bot triggers are not only the one scripts used by bfexplorer. You can use scripts in Bfexplorer Console tool as well:

http://bfexplorer.net/Articles/Content/422

This script shows how to automate loading of betfair api data by some set criteria to spreadsheet document.

I see you like to place SP bets when executing your strategies, so you had found my script:

https://gist.github.com/StefanBelo/3baa73a8a33adb5147fecd4d75bf22ed

I already mentioned bfexplorer built-in bots, so when offered features do not fit to what a strategy should implement, there is always way to add new required features to bfexplorer app, and the quickest way is to program bot trigger code.

This script code had been written to show how to automate this strategy:

http://bfexplorer.net/Articles/Content/390

If you want to place SP bet in your strategy “Horse Racing Betfair ML Ranks Trigger”, then use built-in bot named “Place SP Bet”. If you test your strategy in practice mode then use just “Place Bet” bot.

Please watch my video, it shows how in couple clicks you can automate your strategy. As stated before I would remove your horse racing ML strategy from your web site, or just renaming it to ML lay strategy.

Comments ( 1 )


  • Betfair Bot
    8.8.2019 13:15:30

    BDP team from Australia made great work and added my bfexplorer app to list of third party tools suitable for running fully automated strategies on betfair exchange:

    https://betfair-datascientists.github.io/thirdPartyTools/bfexplorerintro/

    Just to add to the list of mentioned features, web browser view is not just browsing my web site.

    The web browser inside the app allows integration of any web site offering additional data for trading, or just data visualization, please have a look at here:

    Analyzing betfair data to trigger trading on horse racing markets.

    So how does it work?

    As web browser is integrated in bfexplorer app, web browser “knows” which market you have got open in Bet Event view, and which selection is active.

    Then there is simply rule for parameter naming, read article above:

    {eventId} {marketId} {nMarketId} {selectionId}

    So if you have got web site which offers data to betfair market ids directly then you can simply replace that parameters in url. Your web site works with betfair ids directly, and in fact you offer additional information for bettors or traders, so you could as well create such easy accessible web page, and bfexplorer user could have such information in one click.

    Another way of using this browser is with bot sdk code, for web site where there is no direct betfair ids information on web site, so only one way to automate web page from third party provider is to make short program to “translate” available information to exact web page url, I did so for instance for sofascore that brings additional statistics and live stream through bet365 for tennis matches (of course you must have account with bet365 to watch live tv stream).

    Betfair Tennis Trading Automation