StefanBelo/BetfairAiTrading
56.0
Adequate · 15 November 2026
7k
lines of production code
Python
with F#, C#, JavaScript, TypeScript
5
measurements over time
What this system is
Features
Added Docker configuration and documentation for TuskBot
Users can now deploy the TuskBot service using the provided Docker Compose setup. The change introduces a compose.yaml file that defines the TuskBot service using the ghcr.io/sandevgo/tuskbot:latest image, along with a persistent volume for data storage. Supporting Windows batch scripts (configure.cmd and run.cmd) and a documentation file (Doc.txt) have also been added to facilitate installation and execution.
docker · high confidence
Added script to validate internal consistency of Horse Racing trading reports
A new Python script, \scripts/validate\_trading\_report.py\, has been added to verify the arithmetic integrity of \TradingReport.md\ files generated by the HorseRacingVDWStrategyBot. The tool parses the markdown report and re-derives key metrics—including model probability totals, de-vigged market probabilities, expected value (EV), edge, and rank—to ensure they are mathematically consistent with the source data. It also validates that execution directions align with favorite EV signs and that profit targets follow the defined rounding logic, helping users detect calculation errors or copied columns in handicapping reports.
python · high confidence
Added trainer data provider and CSV export
A new F\# script (TrainersData.fsx) has been added to fetch trainer information from the horseracing API and export it as a CSV file (Data/Trainers.csv). This provides a static dataset of trainers and their postcodes for use by other components.
src/DataProviders · high confidence
Introduce Betfair Market Analyzer with technical analysis and reporting
Added a new C\# application in src/BetfairMarketAnalyzer that performs technical analysis on Betfair betting market data using the Skender.Stock.Indicators library. The tool calculates indicators such as RSI, MACD, Bollinger Bands, and moving averages, while also detecting support/resistance levels, volume spikes, and market flow (backing vs. laying pressure). It generates comprehensive markdown reports with trading strategy recommendations (e.g., scalping, back-to-lay) and risk assessments, and includes example code in src/Examples to demonstrate usage with sample market data.
src/BetfairMarketAnalyzer, src/Examples · high confidence
Introduce Python implementation of Betfair Market Analyzer
A new Python-based Betfair Market Analyzer has been added as a counterpart to the existing C\# version, providing comprehensive technical analysis on betting market data. The application uses TA-Lib (with a pandas/numpy fallback) to calculate indicators such as RSI, MACD, and Bollinger Bands, and generates detailed markdown reports covering market flow, support/resistance levels, and trading recommendations. It includes a sample data generator for testing, cross-platform startup scripts, and a setup configuration for distribution.
betfair-market-analyzer-python, src/BetfairMarketAnalyzerPython · high confidence
New 'Hello Betfair' educational strategy examples in C\#, F\#, and Visual Basic
Added a new 'Hello Betfair' folder containing educational examples that implement a simple trading strategy across three languages (C\#, F\#, and Visual Basic). The strategy automatically places a back bet on the first favorite market selection with a price between 2.5 and 3.0, using configurable parameters with those defaults. The F\# implementation also includes a custom DSL (Domain Specific Language) for defining trigger logic. These files serve as reference implementations for the bfexplorer app platform.
src/HelloBetfair · high confidence
New Betfair trading chart examples added
Added two new HTML examples in the examples/html directory: BetfairPriceChart.html, which displays static market data and price movement charts using Plotly, and BetfairTradingChartDynamic.html, which extends this with a user interface for inputting custom JSON data to dynamically render trading charts.
examples/html · high confidence
New Bfexplorer Studio example notebooks for API, bots, and AI charts
The examples/BfexplorerStudio directory now includes a set of F\# script files (.fsx) and corresponding Verso notebook files (.verso) that serve as interactive getting-started guides. These examples demonstrate how to use the Betfair API to retrieve market data, implement custom strategy bots and triggers within the Bfexplorer environment, and visualize AI-driven selection analysis using Plotly.NET charts.
examples/BfexplorerStudio · high confidence
New Bfexplorer scripting examples and documentation
Added a collection of F\# script examples and documentation to the Bfexplorer location, demonstrating how to interact with the platform's console and services. These include scripts for opening markets, calculating and displaying selection probabilities, generating interactive Plotly charts for price history, and reading/writing data to spreadsheets via bot triggers. The set also includes utility scripts for inspecting the IBfexplorerConsole interface and markdown documentation outlining implementation steps for charting features.
src/Bfexplorer · high confidence
New C\# AI agent for automated Betfair betting strategies
Added a new C\# application (src/AiAgentCSharp) that connects AI language models (via Azure AI Inference and Microsoft.Extensions.AI) to the BfexplorerApp MCP server to automate betting strategies. The agent retrieves active Betfair market data, performs Expected Value (EV) analysis on horse racing form, and executes 'Bet' or 'Lay' strategies based on conservative criteria. It supports multiple AI providers (GitHub Models, DeepSeek, AI Hub Mix, local proxies) and uses user secrets for API key configuration.
src/AiAgentCSharp · high confidence
New F\# Betfair Market Analyzer with technical analysis and reporting
Introduced a new F\# implementation of the Betfair Market Analyzer that performs technical analysis on horse racing markets using the Skender.Stock.Indicators library. The tool calculates indicators including RSI, SMA, EMA, MACD, and Bollinger Bands, while also analyzing market flow (backing vs. laying pressure) and detecting volume spikes. It generates comprehensive markdown reports containing selection analysis, trend direction, and trading recommendations (such as scalping strategies) with confidence levels, and saves these reports to files with timestamps.
BetfairMarketAnalyzerFSharp, src/BetfairMarketAnalyzerFSharp · high confidence
New Market Data Browser web application for Betfair markets
A new React-based web application has been added to view and analyze Betfair market data, featuring a sidebar for market selection with search and filtering, and a main area that switches between tabular and chart views based on the selected data context. The app integrates with the backend API to fetch market lists, active market status, and specific market details, while supporting multiple data contexts such as Timeform ratings, Racing Post data, and OLBG tips displayed via AG-Grid tables, as well as price history visualized using TradingView's Lightweight Charts. State management is handled by Zustand, and the UI is styled with the Inspinia theme, providing a responsive layout for desktop and mobile devices.
src/MarketDataBrowser · high confidence
New documentation and trading-analysis helper scripts
Added a suite of Python scripts to the \scripts/\ directory to support the BetfairAiTrading project. \maintain\_docs\_metadata.py\ automatically generates YAML frontmatter (titles, types, tags, MCP tools, and data contexts) for markdown files to improve organization in Obsidian. \ingest\_docs.py\ flattens the documentation into a single text file for use as LLM context. \validate\_trading\_report.py\ checks the internal arithmetic consistency of handicapping reports. \parse\_strategy\_logs.py\ extracts key fields from AI strategy logs, while \analyse\_5oct.py\ reconciles these logs against settled bet records to calculate executed P&L and counterfactual returns. \analyse\_dutch.py\ simulates Dutch staking strategies on daily reports to evaluate potential profitability.
scripts · high confidence
New domain model for race result analysis
A new domain layer has been introduced to support the analysis of racing results. This includes definitions for specific performance features (such as SpPrice, GoingRank, and TSRank), a rule engine for filtering candidates based on feature thresholds, and configuration structures for search parameters and betting strategies. The model also defines the output structure for strategy evaluation, including profit, ROI, and bet statistics.
AnalyzeResults · high confidence
New horse racing analysis and data export tools
This change introduces a new F\# application suite within the RacingStatto module to analyze horse racing results and export data for machine learning. It includes a data export tool that fetches race results from a local API and writes them to a CSV file (MlData.csv) with specific columns like ranks and odds. Additionally, it provides an analysis engine that evaluates betting strategies using both manually defined rules and automatically derived rules based on historical winners, calculating metrics such as profit and ROI.
src/RacingStatto · high confidence
New horse racing bot to close positions on rank drops or favorite odds thresholds
A new automated trading strategy, CloseByPositionDifferenceBotTrigger, has been added for Horse Racing WIN markets. The bot monitors the favoritism rank of selections and automatically closes open bet positions when a selection's rank drops by a configurable number of positions (default 2) or when the favorite's odds fall below a specified threshold. It includes configurable settings for the position difference, minimal favorite odds, and optional logging of position changes.
src/Strategies/HorseRacing · high confidence
New script to open football markets based on score difference
A new F\# script, OpenMyFootballMarketsByScore.fsx, has been added to the Football strategies folder. This script connects to the Betfair API via the BeloSoft Bfexplorer service to retrieve active football matches and opens specific markets for matches where the score difference is greater than zero. It utilizes the FootballScoreProvider to fetch live data and filters matches before invoking the OpenMyMarkets function, providing a new automated way to target football markets based on current game states.
src/Strategies/Football · high confidence
New strategy configurations for Football, Tennis, and Horse Racing
Added new JSON configuration files in the data/Strategies directory to define execution parameters for specific sports strategies. These include Football match time criteria and market opening by score, Tennis data export and market opening by score, and Horse Racing bookmakers odds and race distance triggers. Each file maps specific BetEvents (such as 'Football - In-Play Now' or 'Horse Racing - GB and IE') to corresponding scripts or bot strategies, establishing how and when these automated actions should be triggered.
data/Strategies · high confidence
New tennis-specific trading scripts for market selection and spreadsheet tracking
Two new F\# scripts are added to the Tennis strategy folder. OpenMyTennisMarketsByScore.fsx provides a script that identifies active tennis matches in the second set with a 1-0 or 0-1 score and automatically opens markets for those matches. TennisDataToSpreadsheet.fsx introduces a bot trigger that updates a DevExpress spreadsheet with real-time tennis match scores (points and set scores) and current back/lay prices for match odds markets.
src/Strategies/Tennis · high confidence
Repository restructured for AI-driven trading workflows and documentation
The repository has been reorganized to support AI agent integration and automated trading strategies. A new solution file (BetfairAiTrading.slnx) defines the project structure, including C\# AI agents, F\# strategy bots, and data analysis tools. Documentation has been significantly expanded and restructured, with a new index (README.md) and a flattened context file (docs\_context.txt) designed for AI ingestion. Configuration files for the Reasonix AI agent and .NET SDK 10.0.401 have been added, while the legacy Visual Studio solution file was removed.
(repo-wide) · high confidence
Removals
Removal of F\# console application scaffold
The default F\# console application entry point (Program.fs) and its associated build artifacts have been removed from the src/App directory. This eliminates the 'Hello from F\#' output and the net9.0 project configuration for this specific location, effectively stripping out the initial scaffolding code.
src/App · high confidence
Behavioural changes
1 commit (0 fixes) modifying data
A change to existing behaviour in data — 1 commit, 1 file: “HorseRacingRaceDistanceBotTrigger”.
data · low confidence · unverified
4 commits (0 fixes) modifying data/BetEvents
A change to existing behaviour in data/BetEvents — 4 commits, 5 files: “FootballInPlayNow”; “Football Strategy with Match Time Criteria”; “Tennis”; and 1 more.
data/BetEvents · medium confidence · unverified
BfexplorerApp agent session history now includes token usage and reasoning metrics
The BfexplorerApp agent's session history files now record detailed AI model usage data, including token counts (input, output, total) and reasoning tokens. This metadata is captured in the session history JSON, allowing users to track model consumption and reasoning overhead for each interaction.
src/AiAgentPython · high confidence
Test coverage
Added horse racing market test fixtures
Added seven new JSON test data files in the \data/TestData\ directory to support testing of horse racing market analysis features. These fixtures include \MarketSelectionsCandleStickData\ (files 1–6) containing OHLCV candlestick series, VWAP, and back/lay ratios for specific selections, as well as \MarketSelectionsPriceHistoryData\ with granular time-price-volume history, and \RacingTvDataForHorses\ providing detailed horse profiles, form, and performance statistics.
data/TestData · high confidence
Dependencies
New AI agent, market analysis, and browser tools with updated dependencies
This update introduces several new project scaffolds and dependency configurations across the codebase. The \AiAgentCSharp\ project is added targeting .NET 10.0 with packages for Azure AI Inference, OpenAI, and Model Context Protocol, while the \AiAgentPython\ project is introduced with a dependency on \fast-agent\. Betfair market analysis capabilities are expanded with new F\# (\BetfairMarketAnalyzerFSharp\) and Python (\BetfairMarketAnalyzerPython\) projects using libraries like \Skender.Stock.Indicators\, \pandas\, and \plotly\. The \MarketDataBrowser\ React application is added with \ag-grid\ and \lightweight-charts\ for data visualization. Additionally, the original \App\ project has been renamed to \BetfairMarketAnalyzer\ and migrated from .NET 9.0 to .NET 8.0, and \RacingStatto\ F\# tools are updated to target .NET 10.0.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 52 → 56 (+3.6)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 83 → 83 (-0.4)
- Architecture 97 → 98 (+0.3)
- Maturity 77 → 88 (+11.1)
- Readiness 19 → 18 (-0.5)
- Security 79 → 99 (+19.7)
- Performance 100 → 100 (+0.0)
Resolved (22)
- Classify ADR enforcement: 2026 World Cup Prediction Analysis & Trading Opportunities (docs/Ideas/2026 World Cup Prediction Analysis.md)
- Coverage not measured — .NET suite
- Duplicated block (25 lines × 2) (src/AiAgentPython/agentBet.py)
- Duplicated block (6 lines × 2) (src/BetfairMarketAnalyzerPython/services/technical_analysis_service.py)
- High CVE: [GHSA redacted] (src/MarketDataBrowser/package-lock.json)
- Rotate the exposed credentials — git history can't be un-committed
- Secret: aws-access-token (src/RacingStatto/Data/Parameters.ows)
- Secret: generic-api-key (.vscode/settings.json)
- analyse_5oct.main (cognitive 100) (scripts/analyse_5oct.py)
- analyse_5oct.main (cyclomatic 60) (scripts/analyse_5oct.py)
- analyse_dutch.main (cognitive 38) (scripts/analyse_dutch.py)
- analyse_dutch.main (cyclomatic 21) (scripts/analyse_dutch.py)
- maintain_docs_metadata.extract_metadata (cognitive 38) (scripts/maintain_docs_metadata.py)
- maintain_docs_metadata.extract_metadata (cyclomatic 47) (scripts/maintain_docs_metadata.py)
- maintain_docs_metadata.process_file (cognitive 20) (scripts/maintain_docs_metadata.py)
- maintain_docs_metadata.process_file (cyclomatic 16) (scripts/maintain_docs_metadata.py)
- parse_strategy_logs.parse (cognitive 42) (scripts/parse_strategy_logs.py)
- parse_strategy_logs.parse (cyclomatic 25) (scripts/parse_strategy_logs.py)
- validate_trading_report.parse (cognitive 21) (scripts/validate_trading_report.py)
- validate_trading_report.parse (cyclomatic 16) (scripts/validate_trading_report.py)
- …and 2 more
New (6)
- Edited copy of a member (44 corresponding lines) (src/BetfairMarketAnalyzerPython/services/technical_analysis_service.py)
- Edited copy of a member (75 corresponding lines) (src/RacingStatto/FSharp/AnalyzeResults/Models.fs)
- High CVE: [GHSA redacted] (src/MarketDataBrowser/package-lock.json)
- redundant comment (src/MarketDataBrowser/src/components/ChartDisplay.tsx)
- redundant comment (src/MarketDataBrowser/src/components/ChartDisplay.tsx)
- redundant comment (src/MarketDataBrowser/src/types/index.ts)
Changes since last survey
- 5 commits — 5 feature/other, 0 fixes
By area
- docs/Strategies — 3 commits
- docs/Posts — 1 commit
- docs/Research — 1 commit
Notable commits
- change: AI expert opinions
- change: Agentic Bfexplorer: Auditing a Live Strategy
- change: AllRacesHorsesData
- change: BetfairAiTrading Inspired by Odds Wizard
- change: Create George Wickham_Winner.png
Architecture
- Unchanged — 2 containers · 4 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
StefanBelo/BetfairAiTrading was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit ae92657401a4b5c08ed1f58687176e789a9a2852 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.