Skip to content

Long shots, outside view, closing-line guard, objective evidence - #21

Merged
botta0oss merged 1 commit into
mainfrom
claude/lucid-lovelace-h1c8tm
Sep 25, 2026
Merged

botta0oss merged 1 commit into
mainfrom
claude/lucid-lovelace-h1c8tm

Conversation

@botta0oss

Copy link
Copy Markdown
Owner

Four more guards against the losses seen in the first simulated portfolio.

What changes

  1. No long shots. No buys of shares under LONGSHOT_MIN_PRICE (10¢), on either side. This applies to both the economic assessment (blocking reason longshot) and the strategy's buy levels. Long shots win less often than their price says (favourite–longshot bias).
  2. Outside view first. Jev is asked for a base_rate (how often similar events happen) before resolves_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.
  3. Closing-line guard (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.
    • A category averaging below −2 points over at least 5 bets is excluded from automatic bets. The exclusion is visible in the exclusions list and can be removed there.
    • Overall, at least 8 bets below −2 points pauses automatic bets and sends a Telegram message.
    • The portfolio page shows the reason, and an admin can resume with POST /portfolio/guard/resume. Bets placed before the resume are not counted again.
    • Manual bets are never blocked.
  4. Objective evidence strength. Evidence strength = min(Jev's rating, a rating computed from the facts). The facts rating weighs outlet reliability × freshness × Jev relevance, adds weight for confirmations and for primary sources, and maps the total through EVIDENCE_OBJECTIVE_HALF. Both values are stored, and the backtest uses the same rule.

Also updated

  • New prediction and settings columns, with migrations.
  • API schemas, /status, Excel export, the settings page and the explanation card.
  • EN/IT texts and docs (method, strategy, configuration, API, development).
  • .env.example.

Tests

  • tests/test_evidence.py (6 new tests). Older tests run with the new rules turned off through conftest env vars.
  • 214 passed.
  • Playwright smoke test on the portfolio pause notice and resume, the explanation card and the settings page, in IT and EN: no JS errors, no missing translations.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj


Generated by Claude Code

- 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
@botta0oss
botta0oss merged commit 71de6bf into main Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants