From bef01d50200bda9db9eea7b8f725b298d0dff2f1 Mon Sep 17 00:00:00 2001 From: betbetter Date: Sat, 14 Nov 2026 01:16:53 +0100 Subject: [PATCH] Add margin --- margin.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 margin.py diff --git a/margin.py b/margin.py new file mode 100644 index 0000000..3690308 --- /dev/null +++ b/margin.py @@ -0,0 +1,3 @@ +def margin(prices): + """Bookmaker margin from decimal prices (0.05 = 5%).""" + return sum(1.0 / p for p in prices) - 1.0