Forum Article

Football League Pre Game Strategy

I've been doing a trial on bfexplorer and for the most part I am impressed with the software, however I'm having difficulties applying my strategies.

This is what I am trying to achieve:

Let's say I want to place a Back Bet on the MATCH ODDS market for specific leagues in Football... EPL, Championship, League 1, Serie A, La Liga... etc

However, each league has different rules settings. For example:

EPL: Back Home Team when odds are between 1.5 - 2.0
League 1: Back Away team when odds are between 2.0 - 2.5
La Liga: Back Favourite when odds are 1.0 - 1.5
Championship: Back Underdog when odds are 3.0 - 3.5

I'd like the bot to scan the available games in those leagues say 15mins before kick off and place a back bet for any game that meets the above criteria.

In addition, let's say I have an arbirtary constant value that I set for each league. For example:

EPL: Value = 0.5 this week and changes to Value = 0.6 next week and changes to Value = 0.4 the 3rd week

I'd like to set the bot to only place the above Back Bets if say the value is above above 0.45. So for EPL it would place the back bets this week and next week, but not on the 3rd week.

What is the best way to create the above strategy? Where do I put this constant?

  • Add Your Comment

    +

    Please login to your bfexplorer account, if you want to add a comment to this article.

Comments ( 17 )


  • Nicksim80
    18.8.2019 2:09:35

    OK I managed to change the script file and get it to build in the IDE environment with no errors by linking all of the references, but still unable to export it and get it to work in bfexplorer.

    Also, still having issues connecting to Bfexplorer BOT SDK. Maybe you can do a video showing how this is done for the first time in Visual Studio. I'm sure this will help a lot of the newbies. The coding I can probably work out, but it's the setup work that is tricky as it is specific to bfexplorer and difficult to find help on google for this.

  • Stefan
    18.8.2019 11:25:14

    Nick, I hope you will finally manage to do it, as frankly to say what you ask is just common work of software developer, when he uses external libraries/assemblies and build a new one that will be used by hosting application. The hosting application is in this case the bfexplorer app.

    ** Some words for non programmer/software developers.

    What is IDE? Basically it is editor allowing to write code and build that code to (executable) assembly to run it and debug. IDE – Integrated Development Environment like Visual Studio, or Visual Code, both from Microsoft, available for free in Visual Studio Community version.

    So you managed to build the bot trigger assembly, if you want to execute and debug this assembly then it must be loaded by hosting application and its infrastructure, so the simplest way is to set Build Output path of your bot assembly to:

    C:\Program Files (x86)\BeloSoft\Bfexplorer

    Yes, to the folder where bfexplorer app is installed to. As this is the application folder, a common windows user has no writable access to. You must run your IDE as administrator.

    How your code, so your bot trigger assembly can be executed in the first, and how the assembly can be loaded to the bfexplorer app domain, so you would be able to debug your bot code?

    Your bot trigger assembly is .dll file, so file that cannot be executed directly. To execute it/load it to bfexplorer app domain, you simply switch Debug Start Action to Start external program:

    C:\Program Files (x86)\BeloSoft\Bfexplorer\Bfexplorer.exe

    Nick, what I have wrote up to now is just common way of doing work, when you need to execute and debug assembly with hosting application, so it is not specific task just for Bfexplorer BOT SDK. If you are software developer you may have done that many times.

    ** The following task is specific for bfexplorer app.

    Ok, we have got bot trigger assembly and we were able to run bfexplorer app from our IDE. In my post about Bfexplorer BOT SDK, you could read how to set Debug \ Start Options \ Command line arguments, so when executing bfexplorer from IDE it automatically logins to betfair and switch Practice Mode on, of course when debugging bot we do not want to place real bets on betfair, right?

    Bfexplorer app does not know anything about your bot trigger assembly for now, simply because it was not yet loaded to app domain. It is quite different with bot assemblies, like this one:

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

    Where all bots declared by this bot assembly:

    https://github.com/StefanBelo/Bfexplorer-BOT-SDK/blob/master/MyFsharpBot/Bots.fs

    Are loaded by bfexplorer automatically, all what such bot assembly must fulfill is implement IBotCreator interface, and the name of assembly must end with .Bot

    Your bot assembly is compiled bot trigger, so bfexplorer app loads such trigger using "Execute Trigger Bot", and I actually showed that in my video above. In this case you do not use bot trigger code, so .fsx file, but compiled .dll assembly file, so just swith to .dll and browse your file in:

    C:\Program Files (x86)\BeloSoft\Bfexplorer

    When setting the bot parameter: TriggerFilePtahName

    More information about Bfexplorer BOT SDK can be found in my post on forum, just search: SDK

    http://bfexplorer.net/Articles/Search?text=SDK

    SDK means Software Development Kit.

  • Nicksim80
    18.8.2019 13:04:51

    Thanks, I got it to work after many attempts. I am not a software developer or programmer, but I can learn enough to get things to work.

    I still think you should do a video as many of your users are not software developers or programmers and this would help them get started with your SDK and become familiar with IDE's and setting up the references and outputs.

    Once you understand that process you can learn to write and debug your code and eventually get it to work.

  • Stefan
    18.8.2019 14:15:41

    Nick, what you do is expert level for betfair trader, and common users can use just built-in bots and set automation/so create their betting or trading strategies just by setting bot parameters, so without programming.

    You are maybe that Nick, who used bfexplorer back in 2007 when I started developing bfexplorer. A lot of changed from that time, a lot of apps had ended and new one comes, and I believe you used most of betfair apps on the market up to now.

    Even those apps, which are labeled user friendly for automation, are actually not so user friendly when specific task must be executed, so not just task prebuilt in rules settings dialogs like market feeder or betangel use, and forums of these betfair apps just confirm what I say because it is full of simple questions users asked, well at least from my point of view:

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

    Very good example is this one:

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

    Because it shows how bfexplorer app manages strategy automation by comparing to other betfair apps, for which BDP team from Australia made tutorials:

    https://betfair-datascientists.github.io/#using-third-party-tools-for-automation

    And my tutorial:

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

    Actually, your request for strategy automation is similar to one presented by BDP Australia. You have got ML model that generates those coefficients for your prefer football leagues, maybe similar like FiveThirtyEight

    https://projects.fivethirtyeight.com/soccer-predictions/

    And you need to automate your betting strategy, so by league you run preset strategy when your coefficient met set criteria.

    This automation task has again nothing with betfair, it is just programming task to conduct result of one app as the input to the other app, and it is task for software developer or just skilled user.

    You must realize what you want to do and how, and to understand that you must learn by doing.

    Just a hint from my understanding of your strategy automation, build your custom bot to do really just specific task, so:

    Load you data, and tagged them by league name.

    Your custom build trigger will identify league of the match/market.

    From league name you find your coefficient and evaluate it whether is in allowed range. If it is in allowed range, you execute preset league strategy, created from pre built bfexplorer bots.

    This way you will get bot trigger which will do just this specific task, the rest is done by bfexplorer bots, so this way you can simply switch from just placing a bet, like you do with “Place Bet” bot strategy settings to trading strategy when you like, using “Place Bet and Close Selection Bet Position” bot settings.

  • Stefan
    19.8.2019 10:15:59

    It is good you posted your request to betangel forum. We will see what solution will be offered:

    Automation : Football Pre-Game Strategy

  • Nicksim80
    24.8.2019 3:47:44

    Yes, just trying to work out what is the best solution for my needs.

    So far I think bfexplorer is best long term solution, but it requires me to get the programming to work.

    Where as I can achieve my strategies with Bet Angel, but it takes a lot of spreadsheets to make it work. There is no elegant solution with Bet Angel.

  • Stefan
    24.8.2019 9:17:15

    I do not think Bet Angel can execute your fourth strategy:

    Championship: Back Underdog when odds are 3.0 - 3.5

    Because similar like my “Place Bet” bot, when you sort selections, all selections are included. So to get underdog, the naïve approach is to sort selections by Last Traded Price, and the second item in sorted list is underdog, but as all selections are taken, The Draw selection could be second one as well, therefore you need custom script like I did here:

    FootballExecuteOnUnderdogBotTrigger.fsx

    I would suggest you to post your request to market feeder as well. They have similar policy like me, for subscribers they build one simple trigger for free, otherwise you must pay for it.

    I have some case studies for market feeder as well:

    http://bfexplorer.net/Articles/Search?text=feeder

    And bfexplorer could execute any strategy market feeder users have problems with.

    I just wonder if market feeder can manage to execute your strategy simpler way. Your automation script for skilled developer is no problem at all, using Bfexplorer BOT SDK.

    Just for inspiration, your FootballExecuteOnUnderdogBotTrigger.fsx uses: ExecuteActionBotOnSelection to execute your preset strategy, entered by BotName parameter on selection the bot trigger script evaluate.

    As you can setup all your strategies by “Place Bet” bot, your strategy requires choosing exact named bot strategy for exact league.

    The league is stored in the property of BetEvent object:

    market.MarketInfo.BetEvent.Details

    You can get it from Market object. So five lines of code in F# (have a look at match keyword) will give you the name of strategy that should be executed, and in your bot trigger code such bot strategy can be executed by:

    TriggerResult.ExecuteMyActionBotOnSelectionWithParametersAndContinueToExecute (botName, mySelection, None, false)