Agent builders
How an AI agent measures closing line value
Closing line value is the standard way to judge a source of picks or signals without waiting for results. This guide gives the formula, a worked example, a logging loop an agent can run, and the limits of the method.
By DeepChamp research team · Updated
Short answer
Closing line value is the gap between the price available when a signal was issued and the market’s closing price on the same side. An agent measures it by logging each signal with its entry price, reading the closing prices of both sides from its own licensed feed at the start time, removing the margin, subtracting the entry probability, and averaging the gaps over a large sample with an interval.
The formula
- Entry probability = 1 / decimal odds of the price you could take when the signal was issued.
- Closing probability, margin removed = (1 / decimal odds of your side) divided by the sum of (1 / decimal odds) for both sides at the close.
- Closing line value, in probability points = closing probability minus entry probability. Positive means the market closed on your side of the price you took.
- Expected value at the close, per unit staked = decimal odds taken times closing probability, minus 1.
Remove the margin before you compare. Both closing prices include the operator’s margin, so a raw comparison overstates or understates the gap. The free closing line value calculator on this site does the arithmetic in your browser and sends nothing to a server.
A worked example with hypothetical prices
| Step | Value |
|---|---|
| Price taken (American) | -105, which is 1.952 in decimal odds |
| Entry probability | 51.22 percent |
| Closing prices | -120 on your side and +100 on the other side |
| Closing probabilities with margin | 54.55 percent and 50.00 percent, which add to 104.55 percent |
| Closing probability, margin removed | 54.55 divided by 104.55, which is 52.17 percent |
| Closing line value | 52.17 minus 51.22, which is +0.95 probability points |
| Expected value at the close, per unit | 1.952 times 0.5217 minus 1, which is +1.86 percent |
These prices are hypothetical and are not a DeepChamp signal, a live market or a claim about performance. Closing line value measures the quality of a price. It does not say whether any one bet won.
A logging loop an agent can run
The two functions below are the whole calculation. They are tested against the worked example above.
import random
import statistics
def american_to_decimal(a: int) -> float:
return 1 + a / 100 if a > 0 else 1 + 100 / abs(a)
def clv_points(entry: int, close_side: int, close_other: int) -> float:
"""Closing probability with the margin removed, minus the break-even probability of the price taken."""
p_entry = 1 / american_to_decimal(entry)
side = 1 / american_to_decimal(close_side)
other = 1 / american_to_decimal(close_other)
return side / (side + other) - p_entry
def mean_ci(values, n_boot=2000, seed=7):
"""Mean and a 95% bootstrap interval. Report the sample size next to it."""
rng = random.Random(seed)
means = sorted(statistics.fmean(rng.choices(values, k=len(values))) for _ in range(n_boot))
return statistics.fmean(values), means[int(0.025 * n_boot)], means[int(0.975 * n_boot)]
# One signal: price taken -105; the market closed -120 on this side and +100 on the other.
print(round(clv_points(-105, -120, 100), 4)) # 0.0095, about +0.95 probability pointsThe loop around them has three steps: store each signal with the price your own feed offered at that moment, read the closing prices of both sides from the same feed at the start time, and report the mean with its interval and sample size. DeepChamp for Agents signals carry a closing reference time that is a timestamp and never a price, so your agent supplies the prices from a feed you are licensed to use.
# 1. When a signal arrives, store it with the price YOUR feed offered at that moment.
log.append({
"signal_id": signal["signal_id"],
"content_hash": signal["content_hash"],
"issued_at": signal["issued_at"],
"close_at": signal["market_close_reference"]["reference_time"], # a timestamp, never a price
"entry_price": my_feed.price(signal["game_id"], signal["market_type"], signal["side"]),
})
# 2. At close_at, read the closing prices of both sides from the SAME feed.
for row in log.due():
close_side, close_other = my_feed.closing_prices(row)
row["clv"] = clv_points(row["entry_price"], close_side, close_other)
# 3. After a few hundred signals, report the mean, its interval and n.
print(mean_ci([r["clv"] for r in log.done()]))What the method cannot tell you
- It measures price quality, not results. A bet can have positive closing line value and lose; a bet can win after the market closed against it.
- It needs a sample. A single signal says almost nothing. Report the number of signals and an interval, and do not draw a conclusion from a few dozen.
- It depends on your feed. Compare entry and closing prices from the same source, taken at the times you could really have acted.
- The closing price is an estimate of the true probability, not the truth. Thin markets and props close with more noise than main lines.
- It does not replace judgment about stakes, limits and your own risk. Research is not betting advice, and no method guarantees any result.
Common questions
What is closing line value?
Closing line value is the difference between the price available when a bet or signal was issued and the market’s closing price on the same side, usually expressed in probability points after the margin is removed. It is used to judge the quality of a source of picks without waiting for results.
How do I calculate closing line value with American odds?
Convert your price to a break-even probability, convert both closing prices to probabilities and divide your side by the total to remove the margin, then subtract the entry probability from the closing probability. For example, taking -105 and seeing a close of -120 and +100 gives about +0.95 probability points.
How many signals do I need before closing line value means anything?
A few hundred at least, and the exact number depends on how noisy your prices are. Always report the sample size and a bootstrap interval, and treat an interval that includes zero as no evidence either way.
Does DeepChamp for Agents give me closing prices?
No. DeepChamp for Agents never returns odds or prices. Its signals carry a closing reference time, which is a timestamp, so your agent can read the closing market from its own licensed feed and compute closing line value itself.
Is positive closing line value the same as making money?
No. Positive closing line value means the prices taken were better than the closing market on average, which bettors and researchers use as a proxy for edge, but it does not guarantee profit and says nothing about any single bet. DeepChamp makes no claim about results.
This page is published by DeepChamp AI, so read it as one vendor’s view. Examples use hypothetical numbers and are not live markets, picks or claims about performance.
21+ for U.S. sports betting. Follow the laws and age requirements where you are. DeepChamp AI provides independent sports betting research and analysis. It does not accept or place wagers, hold customer funds for betting, or operate a sportsbook. No wins or profits are guaranteed. If you or someone you know has a gambling problem, call or text 1-800-MY-RESET or visit the National Council on Problem Gambling.