trading/shared
Viktor Barzin b82014995c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat(kevin-strategy): integrate expected_move into trading decision
The v2 prompt produces expected_move for every ticker mention. This
commit makes KevinStrategy.evaluate_mention USE it as a hard signal
rather than just a display field.

Three new rules, all guarded by KevinStrategyConfig knobs so the
behaviour can be turned off if it over-filters:

1) SELL + non-bearish expected_move => NO_OP (require_forward_for_
   bearish, default True). This is THE anti-capitulation rule —
   Kevin saying "I sold" without articulating where the stock goes
   next becomes NO_OP. Reactive sells stop translating into
   trades.

2) AVOID + bullish expected_move => NO_OP (don't close, don't
   blocklist). Same idea — if the LLM's forward call contradicts the
   avoid action, treat as inconsistent and skip.

3) BUY + bearish/sideways expected_move => NO_OP (schema veto).
   Catches LLM inconsistency.

4) BUY + unknown expected_move => bump min_conviction floor by
   unknown_conviction_bonus (default +0.05). Forces stronger
   conviction when there's no forward direction.

Tests: 6 new (one per rule above), 22 regression — total 28 GREEN.
Backtest stub _mention factory now defaults expected_move from
action (buy/sell/avoid maps) so existing backtest scenarios stay
green; the test_backtest_sell_mid_position_closes_early case was
the only one that needed the fix.

Side note: strategy is backward-compatible. If a mention has no
expected_move attribute (e.g. v1 stub from older code), it defaults
to UNKNOWN and the legacy code paths still work — just with the
stricter conviction floor on buys.
2026-05-28 22:45:24 +00:00
..
broker feat(phase2): BRACKET orders + Kevin risk caps (Tasks 18, 19) 2026-05-26 21:03:59 +00:00
constants feat(kevin): SA models for bridge audit + backtest persistence 2026-05-24 00:49:52 +00:00
fundamentals feat: add fundamentals DB model and cached provider 2026-02-23 21:49:31 +00:00
models feat(meet-kevin): prompt v2 — forward-looking action + expected_move field 2026-05-28 21:40:07 +00:00
schemas feat(meet-kevin): prompt v2 — forward-looking action + expected_move field 2026-05-28 21:40:07 +00:00
strategies feat(kevin-strategy): integrate expected_move into trading decision 2026-05-28 22:45:24 +00:00
__init__.py feat: project foundation — monorepo setup, shared config, redis streams, telemetry 2026-02-22 15:13:26 +00:00
config.py feat: project foundation — monorepo setup, shared config, redis streams, telemetry 2026-02-22 15:13:26 +00:00
db.py feat: database models and alembic migrations — all tables per design 2026-02-22 15:17:07 +00:00
redis_streams.py fix: resolve 13 important issues from code review 2026-02-22 17:58:01 +00:00
telemetry.py feat: project foundation — monorepo setup, shared config, redis streams, telemetry 2026-02-22 15:13:26 +00:00