Long shots, outside view, closing-line guard, objective evidence - #21
Merged
Merged
Conversation
- No buys of shares under LONGSHOT_MIN_PRICE (10¢) on either side, in the economic assessment and in the strategy's buy levels - Jev is asked for the base rate (outside view) before the forecast and told to move away from it only with strong news; the base rate is stored and shown - Evidence strength is the lower of Jev's rating and one computed from the facts (outlet reliability, freshness, relevance, confirmations, primary sources); both are stored, used in the backtest too - Closing-line guard: when the price keeps moving against the latest bets, the category is excluded or automatic bets pause (Telegram message); admins resume them from the portfolio page (POST /portfolio/guard/resume) - Settings, export, docs (EN/IT), .env.example and tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four more guards against the losses seen in the first simulated portfolio.
What changes
LONGSHOT_MIN_PRICE(10¢), on either side. This applies to both the economic assessment (blocking reasonlongshot) and the strategy's buy levels. Long shots win less often than their price says (favourite–longshot bias).base_rate(how often similar events happen) beforeresolves_yes, and is told to move away from it only with strong news. The base rate is stored with the prediction and shown in the explanation.backend/betting/guard.py). It looks at the latest 15 bets older than an hour, measuring how far the price of the side bought has moved since purchase.POST /portfolio/guard/resume. Bets placed before the resume are not counted again.EVIDENCE_OBJECTIVE_HALF. Both values are stored, and the backtest uses the same rule.Also updated
/status, Excel export, the settings page and the explanation card..env.example.Tests
tests/test_evidence.py(6 new tests). Older tests run with the new rules turned off through conftest env vars.🤖 Generated with Claude Code
https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
Generated by Claude Code