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