Skip to content

feat: F&G column, the stock's fear-and-greed reading on every report row - #114

Merged
yanivil merged 1 commit into
mainfrom
feat/report-fear-greed
Sep 8, 2026
Merged

yanivil merged 1 commit into
mainfrom
feat/report-fear-greed

Conversation

@yanivil

@yanivil yanivil commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Description

Puts the per-ticker fear-and-greed reading of #112 on the report as information, the way the market context was added in #105. No rule uses it.

  • scan.fear_greed (with Wilder's RSI in scan._rsi): the composite moves from tools/backtest.py into the scanner so the report and the replay share one implementation; the backtest imports it. Constants FG_RSI_LEN, FG_BB_LEN, FG_MACD, FG_LOOKBACK join the constants block with the replay evidence in the comment.
  • Signal.fear_greed: one reading per symbol at the last close, set by scan_symbol on every row of that symbol; fear_greed in signals.json.
  • Report: a 14th column F&G after Vol×, and a footer sentence: above 80 the stock is stretched and such breakouts replayed worst, below 20 it is washed out, information only.
  • Wiki 01 output contract, wiki 03 pointer from the tested section to the column, README sample-output paragraph, changelog.
  • The Claude desktop e-mail task's prompt now knows the column and takes the column list from each table's own header row, so it works on reports with or without F&G regardless of when this merges.

Real-data run on 10 tickers: HAL's confirmed breakout reads 73.9, the PH and HAS cup bases read 20.3 and 17.2.

Verified: ruff clean, 137 tests pass (the composite tests moved to scan, scan_symbol sets one reading per symbol and a bare detector does not, the report's 14 columns with the F&G cell equal to the symbol's composite, the footer sentence, and the replay row's fear_greed equal to its fg_score feature).

Related Issues

Related: #113 (the stretch gate), #112 (the features), #101 and #99 (context)

Checklist

  • Code follows existing project style and type annotations
  • Threshold changes include a one-line "why" comment in scan.py (four new constants, commented; no threshold changed)
  • Offline unit tests pass (python -m pytest -q)
  • Random-walk false-positive rate stays under 5% (detection logic untouched)
  • Documentation updated in docs/wiki/
  • CHANGELOG.md updated

🤖 Generated with Claude Code

The composite (RSI 14, MACD-histogram percentile within the trailing year,
Bollinger %B, equal weights, 0-100) moves from the backtest into scan.py as
fear_greed() so the report and the replay share one implementation.
scan_symbol computes one reading per symbol at the last close and puts it on
each of the symbol's signals; signals.json gains fear_greed, the report gains
the F&G column and a footer sentence explaining the zones. Information only;
the stretch gate it suggests is #113.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@yanivil
yanivil merged commit 58b2290 into main Sep 8, 2026
5 of 6 checks passed
@yanivil
yanivil deleted the feat/report-fear-greed branch September 8, 2026 20:10
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.

1 participant