User Comments

  • Stefan
    10.6.2020 13:11:56

    I have just added to your post short video that could help you understand the bot execution in the “Strategy Bot Executor” tool.

    I selected two markets and set the start execution time 5 minutes before official event start, and the update interval to 10 seconds.

    The bot to execute was: Test of ReportMarketDataChanged, just simple bot trigger script to report total matched volume on the market, or text: “No update!” when no data change or update was detected by bot.

    When clicking on Open button the “Strategy Bot Executor” loaded those two markets, and in Output view we could read:

    Strategy/Bot Executor: The next strategy/bot execution is scheduled to: 10. 6. 2020 12:40:00

    And exactly at: 10. 6. 2020 12:40:00

    We can see the message: “The bot Test of ReportMarketDataChanged has been started.”

    And after 10 seconds, in the next bot execution cycle:

    10. 6. 2020 12:40:10 Total matched: 52.54

    And so on every 10 seconds.

    Later I had double-clicked on selected market in the “Strategy Bot Executor” view, what means the market had been open in the “Bet Event” view, and as the bot was still active, it started to report:

    10. 6. 2020 12:40:47 Total matched: 114.72

    10. 6. 2020 12:40:47 No update!

    But of course not in 10 seconds interval but 250 milliseconds one, I use for the active market update.

  • Stefan
    9.6.2020 19:23:49

    When your “BeTheFirstInQueue” bot executes bet placing operation this operation is executed immediately.  

    Now depending on in-play status of the market, placed bet is inserted to betfair market immediately (50 – 150 milliseconds, depending on your connection latency to betfair server), or if market is in-play, after in-play delay time expires (on football markets the in-play delay for bet placing is 8-10 seconds).

    Yes, if your bot is executed by “Strategy/Bot Executor” tool, and you set update interval to 10 seconds, then your bot “BeTheFirstInQueue” is executed each 10 seconds, so also update of bets is done in this interval when “BeTheFirstInQueue” needs to update your bet, but any bet operation is executed immediately.

    I would suggest testing it yourself. Open bfexplorer app and execute your strategy using “Strategy/Bot Executor” tool. Then manually open market in Bet Event view, and just watch how your bets are updated.

  • Stefan
    6.6.2020 17:12:15

    On betfair forum:

    Sir, I am familiar with many programming languages including python I used to make ML model and simple flask api server app to expose ML model to my bots, as mostly I used .net programming languages for betfair bot programming like C# or my favourite F#, and did not find other way to interoperate between python and .net.

    Well yes now I am experimenting with pythonnet to integrate python scripting to my app, for now I support only F# scripts.

    I downloaded your library and it is just wrapper for couple api methods, without implementing any app domain or services. Therefore I really wonder to see some examples of using your library in betfair application, as you say: "My personal bots run 24/7 and never fall over due to program bugs, so I must be doing something right." and “It has been downloaded thousands of times and sometimes people say thank you and send me donations because it has saved them many hours of development time.”

    Well, my library was not download thousands of times, therefore I believe you have got a lot of sample code, for instance implementing this feature, one of Bet Angle users was asking for:
    “how to back the favourite at Betfair SP. I am having problems when the favourite changes late in betting.”

    I have done such simple bot script:

    Betfair SP Favourite Bot Trigger

    And I am really interested to see your python implementation for exact the same simple bot. Your web site was funded in 2008 so I believe your level of expertise is even better than mine. If you show me better solution in python, I will be glad to donate your splendid work and use your library instead of mine.

  • Stefan
    4.6.2020 18:12:02

    I think this is clear, I built bespoke apps or bots only for my subscribers:

    If you want to analyze data on live markets, then this tool may help you:

    Betfair Charts Tool

    If you want to build bot or app according to your specification:

    1) Subscribe

    2) Send me your short description for your app and/or bot

    I hope you understand that your expectation for the project price can be quite different from my price, therefore use your common sense and calculate my average 30 GBP per working hour to expected amount of work for bot or app.

    Of course there is other option for you as I offer Bfexplorer BOT SDK for my subscribers, so if your friend or you, yourself are able to program you can do so, or ask another software developer to do so using Bfexplorer BOT SDK, what is the way I do built bespoke bots or apps for betfair.

  • Stefan
    4.6.2020 13:56:49

    This feature is not yet publicly available, so you can use it only when I built for you bespoke bot.

    I do not work for free, so depending of complexity of your bot, the price starts from 80 GBP (30 GBP working hour).

    I can work for free, when you offer free work for me which I would have any interest in.

  • Stefan
    4.6.2020 10:32:30

    Actually this is not bfexplorer trading app. If you have a look at on the video and app title it says: “Bfexplorer – data analyzer”, so it is different app that looks like bfexplrer, but is mainly used to analyze betfair historical data on ladders, and of course back test different bot strategies you can set in bfexplorer trading app.

    I cannot afford to buy myself betfair historical data, so when developing this app I used pro historical data provided by my subscriber.

    At these days betfair offers for free set of pro historical data, so maybe this app could be used by more subscribers

    On the other hand I will need some time to implement new features to the app, mainly possibly to move forward or back in data. My first implementation loads all data but starts to reply them from 10 minutes before official market start time. Yes, it is possible to restart replying data.

    Therefore this app can be available only to my subscribers, and to those subscribers who can afford to pay my working time to end development of this app, so the app can be used by general user/subscriber.

  • Stefan
    23.5.2020 15:43:21

    If required feature is not yet implemented in pre-built bfexplorer bots you can create your own bot trigger.

    When opening some markets in bfexplorer for monitoring we can see charts in ladders or in the Bet Event grid view in Watched Selections and so on.

    What does it mean?

    It means that bfexplorer app must process some way this data for charts. And yes, software developer using Bfexplorer BOT SDK can find that Selection object offers following property: PriceTradedHistory, and there either TradedPrices or Prices.

    In the user interface of bfexplorer app a common user can browse this data by clicking on selection context menu: Show Selection Data

    Ok, we know where our data are so now we can program simple bot trigger code:


    How the average traded price is calculated can be seen in the function: getAverageTradedPriceFromTime (lines from 48 to 63)

    And how this function is used to trigger an action bot is on lines from 82 to 91.

    What we must realize when developing this kind of strategies is the fact that bfexplorer must monitor market for required time, and that data are stored only for limited time, it is saved 60 last data points.

    There is also other alternative to get traded price. I showed that at the end of my short video.

  • Stefan
    23.5.2020 12:43:38

    For instance when running machine learning strategy on horse racing markets I set Strategy Bot Executor to load horse racing win markets each day at 10:00.  

    Start execution time is set to -15 seconds, because ML strategy requires loading some data for each race.

    Update interval is set to 1 second.

    Now count!

    Strategy Bot Executor before starting bot execution on the market updates market data, that is 1 call to betfair api.

    As the strategy requires those data for each race (it is not data from betfair api), the bot executes download of this data and processing, it takes by average 6 seconds. So during these 6 seconds, as “Strategy Bot Executor” monitors market data, the market data are 6 times updated (bfexplorer 6 times queries betfair api to listMarketBook method) .

    After data are loaded, bot processing them and decides if any bet is placed on this market. As the bot is executed in the update market cycle, in one cycle this data are evaluated and in the next cycle the bot places bet on dedicated selection.

    Update interval is set to 1 second, and we know that any update cycle requires bfexplorer to call betfair api for market data.

    If the bot will not continue with bet placing, the bot execution is finished and so the market monitoring is stopped as well.

    Now count!

    1 + 6 + 2 = 9 queries to betfair api.

    If the bot continues with bet placing, the action bot is created and executed on the dedicated market selection (1 cycle).

    If the bet placing is done by “Place Bet” bot, then from execution of the “Place Bet” and actually placing bet the bot requires additional 1 cycle (have a look at Place Bet parameters).

    Placing bets through betair api is done by other api method: placeOrders. And as the update interval is set to 1 second, but as there are two different api calls done by bfexplorer, and bot operates in the market update cycle, bet placing status must be confirmed in the market update status only, so successful bet placing operation even if takes 200-300ms takes for bot execution in 2 cycles.

    1 + 2 = 3, and totally 9 + 3 = 12 queries to betfair api for market updates.

    Ok, my bot places bet on current offer, and in UK horse racing there is good offer, so bet is immediately matched, If not “Place Bet” bot updates bet to be fully matched, so let say 6 cycles are additional needed.

    12 + 6 = 18 queries to betfair api.

    If there are 100 races per day my strategy requires maximum: 100 * 18 = 1800 queries to betfair api.

    So monthly: 1800 * 30 = 54000

    I simply can count, and try not to use too much betfair resources. Of course, I can execute trading strategies that require monitoring markets for 10-30 minutes, but then again I adjust update interval and try to monitor as less of markets as possible.

  • Stefan
    22.5.2020 22:20:03

     Try to install the latest version of bfexplorer.

    On my dev pc Windows 10, I have no problems all works fine. On my VPS (Windows Server 2012 R2) again all works fine, but on another server I have got the same problems you showed in your video.

    I will need more time to investigate this issue.

  • Stefan
    22.5.2020 22:02:27

    Bodasy, do you really think I am so stupid?

    Please go to my blog posts:

    And you may find that I run many different strategies on my server in 24/7. Well, not these days as mostly I try to run horse racing strategies.

    Once again, any feature you can see in bfexplorer app was programmed mainly for my own needs, by me myself, I am software developer.

  • Stefan
    22.5.2020 21:02:14

    Graf, I do not set those update interval values, but you do so.

    Bfexplorer is used by other users including me. Actually what I program in bfexplorer, I program mainly for my use, and I have never been switched to delayed api data like you three were.

  • Stefan
    22.5.2020 20:44:06

    In Strategy Bot Executor tool you can add column: Total Matched, as in any other data view bfexplorer shows, when market data are updated, Total Matched must be updated as well, right?

    So please, add that column, and watch if value is updated for passive markets waiting for processing, of course they are not updated.

  • Stefan
    22.5.2020 19:35:13


    Tony and Graf, I only try to understand why betfair switched your api access to delayed data, that is all.

    No request is made when you switch off “Monitor passive markets”. Nor “Bot Executor” monitors markets when markets are in passive state.

    Why would I add such option to the settings dialog, when not implementing that feature?

    I can only repeat the same question betfair asked:

    “Please could you explain why your account is reading this volume of data.”

    Betfair knows about any of your activity, the betfair api is their service, and your account is associated with your betfair api access.

    I do not monitor your activity, so I just wonder, when betfair knowing about you everything, that you open a lot of markets, keep them monitoring for some time, but they still asked both of you:

     “Please could you explain why your account is reading this volume of data.”

    So what you are saying is that betfair did not know that you place bets on any market you open? Why they asked you?

  • Stefan
    22.5.2020 17:59:09

    Dear Sirs, I think there is still some kind of misunderstanding from your side.

    Bfexplorer app makes allowed number of requests, otherwise any additional request would be refused by betfair api server with error message, and on your end you would notice that as market data not being updated.

    What is important for you is following question betfair asked:

    “Please could you explain why your account is reading this volume of data.”

    Betfair business model is to earn on any winning matched bet, taking its fee. If your activity on betfair generates enough fees, so you generate more in fees, than costs of your activity on betfair,  any request to betfair api is not free, it takes resource betfair must pay.

    So if your activity costs betfair more than your generated fees, betfair can block your api access, and the first warning is to switch your api access to delayed data.

    What is a trigger level, I do not know, but it can vary from amount of fees you are able to generate for betfair. If you open 100 markets, and actually bet on 2-5 on them, then it is quite suspicious, do not you think?

    Therefore betfair asked you:

    “Please could you explain why your account is reading this volume of data.”

    I do not think betfair would ask you, when for instance you open 500 markets and bet/trade on every market you open.

    I think it is a good idea to read betfair T&C, because you can find there that you can be charged by placing more than 1000 bets per hour as well.

    In this case no data counter would help you, please just use your common sense, and if you open too many markets, bet/trade at least on 25% of them for instance.

    You could ask that betfair as well, but I am not so sure if you would get the answer for that, because then they would declare what is their algorithm for find not so fair customers of theirs.

  • Stefan
    22.5.2020 16:31:16

    Yes, I see that now.

    You have done everything fine. I hope you actually understand what you were doing. The MyBotTriggerExecutor.fsx script is used to execute MyBotTrigger.fsx bot trigger (so bot trigger code) on the currently open market selection.

    It is the way how to force “hot reloading” of code on which you are currently working in your IDE, because when you execute such bot trigger using “Execute Trigger Bot” your trigger bot is compiled to assembly, and any changes in the code are not reflected to bot assembly recompilation.

    I will check what you try to do on the client installation of bfexplorer on my test computer.

    After watching your video, I would suggest adding your favorite events, it seems to be Soccer/Football match odds, and as well to set app layout.

  • Stefan
    22.5.2020 16:03:24

    First of all, what it is active and passive market/s.

    When you open markets in bfexplorer and keep them open, then you have got any time 1 active market, and x passive markets. It is clear when opening just 1 market, there is no passive market open.

    When you open 10 markets, you have got 1 active market, and 9 passive markets.

    In application settings you can set update intervals for active market (the value is in mili seconds) and for passive market/s (the value is in seconds).

    Yes, you can switch off monitoring of passive markets, then for instance if you open 10 markets, then only active market is monitored. Whenever you switch to other market the previous active market becomes passive one, and new selected market becomes active one, so is monitored.

    If you run bots on open markets, then keep in mind that bot is executed only when market data are updated, so in this case, when passive markets are not monitored/so market data are not updated, your bots are not executed on these markets.

    Bfexplorer can execute your bot automatically by Strategy Bot Executor or by Strategy Bot Executor for Selections. In this case you set Start execution time, and update interval. When you click on Open button in the Open in Strategy Bot Executor dialog, then bfexplorer loads x markets (for instance all football matches), but that does not mean that all markets are instantly monitored.

    Markets are monitored from Start execution time (what is relative time to official event start time) and till any bot which is executed by Strategy Bot Executor is still running on the market.

    When your bot ends its execution, the Strategy Bot Executor automatically stops market monitoring.

    I would really suggest using common sense, and when you do not need to monitor market data, you should simply close such market.

    Of course if you open for instance 100 markets, and to all of them you place some bets, so you want bfexplorer to monitor market data, and bets status, or just your bet position, as when manually placing bets on markets, market selections are automatically added to Watched selections view, or you can watch My Bet Position on all markets, then you must wisely set the update interval for passive markets.

    In the Bet Event (Trader) view there is Close button, or in Open Markets view, you can select markets and click on Close button.

    And lastly, I actually mentioned that before. What I can imagine is following use case scenario. Let’s say you are football trader, so you open all matches and associated markets couple hours before kickoff time. Well yes, in such case you can monitor 100 to 300 markets per day, or even more.

    But if you open all those markets just because you want to see price movements, then there are other options, for instance like I showed on Chart Project, so price movement can be shown in charts with monitoring markets for hours. It is simply possible to program any solution for your needs, to avoid problems with taking too much data through betafir api without betting on these markets.

  • Stefan
    22.5.2020 0:23:03

    Sir, such subscription status had been available 3-4 years ago, when I thought that I will be able to create community of people, so instead of me making support they would make it themselves posting on the forum interesting posts and helping each other.

    I failed, and so I removed such option from subscription page:

    Do you think are you able to create such community here, attracting at least 100 people, from which at least 1 person would subscriber, and/or at least 10 people would become active members of this community and so then be able to get free community subscription?

    Bfexplorer app offers BOT SDK as well, so it was the second attempt to create community for betfair software developers, but again I failed to do so. And that is really quite strange, because anyone wanting to develop its own app using betfair api, must buy api access from betfair and such personal api access costs 299 GBP.

    I thought it would be really good deal for software developers, because they can use my code the bfexplorer app is built on to create own bot strategies in very short time.

    Frankly to say such community will never happen here, because betfair trading or betting is quite competitive, so those for whom I had built bespoke bots or apps actually never refer my app to others.

  • Stefan
    21.5.2020 22:26:05

    For what?

  • Stefan
    21.5.2020 14:32:53

    Thanks Graf for sharing your communication with betfair. I hope others will learn from it.

    It is actually common sense you should use when using bfexplorer app, as I did not program any limitation for using betfair api. You can open hundreds of markets with bfexplorer and when still leaving them open the market data are updated in interval set for passive markets.

    Yes, good alternative, mainly when opening a lot of markets is to switch off: Monitor passive markets, then even you open 100 markets, the only one which is actively monitored market is the active one, so the one open in the Bet Event view.

    In this case keep in mind, mainly when you place bets on such markets, that bet status is checked only for monitored markets.

    The other alternative is to use streaming api, betfair limits streaming api to 200 markets you can get market data updated. In this case changes are streamed, so bfexplorer app does not make api request repeatedly like when using rest api, what is default settings for bfexplorer app.

    If you run automated strategies by Bot Executor tools, then again keep in mind that depending on your settings, bfexplorer will additionally make queries to betfair api. Bot Executor tool automatically stops market monitoring for market/s on which no bot is running anymore.

    Bfexplorer offers live score updates for tennis or football, so there is no need to monitor associated markets like for instance Bet Angel users must do, just to judge current score from under/over or correct score markets.

    If you need to monitor market data, just to gather historic data, or price movements if you execute such kind of strategy, then there are means to get such data without actively monitoring markets through betfair api. For instance here I did some experiments with charting:

  • Stefan
    18.5.2020 15:42:13

    I didn't update sdk to the latest version of bfexplorer assembies. Just add default implementation for missing methods. Actually visual studio offers you such option when clicking on interface IBfexplorer