trading/tests
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
..
api_gateway feat(api): /api/meet-kevin/strategy/* routes 2026-05-24 01:12:16 +00:00
backtester feat(kevin-strategy): integrate expected_move into trading decision 2026-05-28 22:45:24 +00:00
fixtures feat(meet-kevin): caption extractor via yt-dlp 2026-05-21 19:40:52 +00:00
integration feat: integration tests, seed data, and smoke test script 2026-02-22 16:02:44 +00:00
services feat(trade-executor): Slack bot-token transport + semver image tags 2026-05-27 10:06:49 +00:00
shared 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
conftest.py feat(kevin): SA models for bridge audit + backtest persistence 2026-05-24 00:49:52 +00:00
test_backtester.py feat: backtesting engine — historical replay with shared strategies 2026-02-22 15:43:19 +00:00
test_broker.py feat: brokerage abstraction layer with Alpaca implementation 2026-02-22 15:26:41 +00:00
test_fundamentals.py refactor: reconcile FundamentalsSnapshot to use canonical schema from trading.py 2026-02-23 21:45:18 +00:00
test_indicators.py feat: add MACD, Bollinger, VWAP, ATR, EMA, SMA-200 indicator computations 2026-02-23 21:49:26 +00:00
test_models.py test(kevin): fix enum assertion + mark Postgres-dependent tests as integration 2026-05-26 20:01:37 +00:00
test_new_strategies.py feat: add 6 new strategies (value, MACD, Bollinger, VWAP, liquidity, MA stack) 2026-02-23 21:50:52 +00:00
test_redis_streams.py feat: project foundation — monorepo setup, shared config, redis streams, telemetry 2026-02-22 15:13:26 +00:00
test_schemas.py fix(schemas): use enum types as field types + enforce symbol length 2026-05-21 19:15:59 +00:00
test_strategies.py feat: productionize local service — fix signal pipeline, lower thresholds, add company-name ticker extraction 2026-02-22 22:17:26 +00:00