Skip to content

Standard RSI, listing-currency financials, and published figures in analyses - #26

Merged
zanwenfu merged 1 commit into
mainfrom
fix/rsi-currency-published-figures
Sep 28, 2026
Merged

zanwenfu merged 1 commit into
mainfrom
fix/rsi-currency-published-figures

Conversation

@zanwenfu

Copy link
Copy Markdown
Collaborator

Three problems found in the 2026-09-28 answers, each verified on real data before fixing.

RSI was not the RSI brokers show

get_technicals averaged the last 14 gains and losses (Cutler's RSI). Brokers show Wilder's smoothed RSI(14).

chat showed standard RSI(14)
Realty Income 4.8 17.4
NVDA 44 55
TSLA 64 55
  • wilder_rsi reproduces the StockCharts ChartSchool worked example exactly: all 19 values.
  • An RSI of 0 keeps its finding card. The check was a truthiness test, so 0 dropped the card.

Cross-listings mislabelled their price and market cap

For Shell's London line, get_financials returned:

  • the price in the reporting currency: "47.80 USD", beside get_prices' 3,611 GBp;
  • the market cap, which is in pounds, labelled USD: 206 billion. In dollars it is $272.7 billion.

As a result, answers said "a market capitalization of about USD 207 billion".

The fix, listing_figures:

  • returns the price and market cap in the listing's currency;
  • adds the reporting-currency conversions, labelled, only when the scraper had an exchange rate (without one it leaves them unconverted);
  • covers every foreign listing, not just Shell.

A ticker the user types is now resolved as typed: "shel" is NYSE SHEL. The home-listing preference stays for a company the user names.

Published ratings lost their analysis

For a published rating, the yes/no check refused sections that named the model's own DCF values. MSFT sometimes answered with the fixed statement alone.

The fix:

  • The guard records the published view: rating, fair value, DCF legs, target and upside.
  • The deterministic check masks exactly those figures before looking for claims.
  • The model check is told the published view.
  • A different rating, any other figure, or a valuation verdict still counts as a claim.

Also fixed: the figure pattern missed a decimal followed by a comma. "a fair value of 180.50, per the report" was not treated as a claim.

Verification

  • 1593 tests pass. Each of 7 mutations was caught.
  • Real questions, production image vs this candidate:
question production candidate
Realty Income RSI 4.8 17
"should i buy Shell?" market cap "USD 207 billion" (wrong) "£208 billion"
"should i buy shel?" looked up "Shell plc" looked up "SHEL" as typed
MSFT, run 1 analysis kept analysis kept
MSFT, run 2 fixed statement only analysis kept
  • XOM and the news question are unchanged.
  • The valuation canary passes.

🤖 Generated with Claude Code

…nalyses

Three problems found in the 2026-09-28 answers.

RSI. get_technicals averaged the last 14 gains and losses (Cutler's RSI),
not Wilder's smoothed RSI(14) that every broker shows. Realty Income read
4.8 after three weeks of falling closes; the standard figure is 17.4.
NVDA read 44 (55) and TSLA 64 (55). wilder_rsi seeds with the simple mean
of the first 14 moves and smooths after that; it reproduces the
StockCharts ChartSchool worked example exactly. An RSI of 0 now keeps its
finding card (the check was truthiness).

Currency. get_financials returned a cross-listing's price in the currency
the company reports in and its market cap, which is in the listing's
currency, under that same label: Shell's London line came out as
"current_price 47.80 USD" beside get_prices' 3,611 GBp, and a market cap of
206 billion labelled USD that is in pounds ($272.7 billion). Answers said
"a market capitalization of about USD 207 billion". listing_figures returns
the price and market cap in the listing's currency and offers the
reporting-currency conversions only when the scraper had an exchange
rate (without one it leaves them unconverted). A ticker the user typed
is resolved as typed ("shel" is NYSE SHEL); the preference for a home
listing stays for a company the user names.

Published figures. For a published rating, the analysis check refused a
section that named the model's own DCF values, so MSFT sometimes
answered with the fixed statement alone. The guard records the published
view (rating, fair value, DCF legs, target, upside); the deterministic
check masks exactly those before looking for claims, and the yes/no check
is told them. A different rating, another figure or a valuation verdict
still counts. The figure pattern also stopped missing a decimal followed
by a comma ("a fair value of 180.50, per the report" was not a claim).

Verified: 1593 tests; 7 mutations each caught; production vs candidate on
real questions: Realty Income's RSI 4.8 -> 17; "should i buy Shell?"
market cap "USD 207" -> "£208 billion"; "shel" resolved as typed; MSFT
kept its analysis where production fell back; XOM and news unchanged;
valuation canary PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zanwenfu
zanwenfu merged commit a310d3d into main Sep 28, 2026
1 check 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.

1 participant