Market research engine

TrendCatcher

The meme stock zeitgeist engine.

Richeson: TrendCatcher — Tools

Summary—A layered Node.js engine that aggregates r/wallstreetbets attention and congressional-trade disclosures into a ranked, terminal-styled pick list. Source-pluggable, and brutally honest.

TrendCatcher is a research desk for sparse, rate-limited information about the market's zeitgeist: what r/wallstreetbets is paying attention to, and what members of Congress have disclosed buying. Free sources answer slowly and throttle anyone who asks too often, so every request waits its turn in one queue, one at a time per provider with a minimum gap (fifteen seconds for Yahoo), and every answer is kept in a dated cache that is asked again only when it can have changed. A full cache warm-up takes a long time, by design, and the age of every number stays on the screen.

The Board is a ranking, not a suggestion. Attention, engagement, momentum, breadth across sources, congressional buying and anomaly are summed with stated weights and scaled to a 0–100 conviction and an A–F grade, which mean “loudest today” and nothing more. Sentiment, the congressional posture and the filing lag sit beside the score with weight zero: context to read, not inputs to the rank.

A ranked name goes to Interrogate, a workbench for one ticker that writes the exit before the entry: a chandelier stop, three targets (certain, peak, runner), the quarterly cone over one to four quarters, the modelled odds of each level being touched, and every figure derived step by step under “Show the work”. The Morning reads each name the same way and labels it BUY NOW, BUY THE PULLBACK, BUY THE BREAKOUT, WAIT or PASS from the plan's own edge.

The person is part of the model. A fourteen-item checklist asks how sure you are; the desk answers the same items from its numbers, says so when you are ahead of the evidence, and caps the decision while any answer is missing. It reads your own ledger and accounts, so cost basis, share counts sized from the loss you accept, tax lots and wash sales come out in your context without retyping. It places no orders: a plan becomes tasks and OCO tickets for you to place, and a date to review it.

The desk teaches itself: a guide and glossary of its terms, a twenty-unit curriculum, and a feature guide performed in pictures, in which one session refreshes AMD, interrogates it, scans 77 names for BUY NOW, and plans a one-year, low-risk buy of the calmest of them in a demo account. TrendCatcher also runs as a one-shot table, a REST API and a keyboard TUI, and its development is written up as IEEE-style lab reports. It is a research tool, not investment advice.

Highlights

  • One polite queue and dated caches for sparse, rate-limited zeitgeist data
  • A ranking by attention and disclosure, not a suggestion
  • Interrogate: the exit plan before the entry, with the odds and the work shown
  • A confidence checklist that keeps the person in check
  • Reads your ledger and accounts; places no orders
  • A built-in guide, glossary, curriculum and a feature guide in pictures

At a Glance

TABLE I TrendCatcher
LanguageJavaScript (Node.js)
Version0.6.0
LicenseMIT
SourcePrivate

The Equations

The formulas behind the figures on the desk, chosen from the 225 in the repository's equation reference, docs/EQUATIONS.md, where each one points at the line of code that computes it. Every one here is copied from the code. Notation: ℓ(x) = ln(1+x); C, H, L, O, V are a day's close, high, low, open and volume; S₀ is the spot price; Φ is the standard normal CDF; a year is 252 trading days and a quarter 63.

TABLE II Ranking the Board
QuantityFormulaWhat it is for
Attentionattention = Σₛ w·ℓ(n), over every source naming the tickerHow loudly the ticker is named, weighted by how far each source is trusted and softened by the log.
Momentummomentum = sgn(Δsrc)·ℓ(|Δsrc|) + sgn(Δrun)·ℓ(|Δrun|)Whether the talk is accelerating, against the last 24 hours and against the last run.
Breadthbreadth = number of distinct sources naming the tickerCorroboration: one forum shouting is not the same as three sources agreeing.
Congresscongress = ℓ(Σₛ w·(buys − sells)) if positive, else 0Net disclosed congressional buying; selling counts as nothing, not as a negative.
Anomalyanomaly = min(4, max(0, (c − μ_c)/σ_c)), c = attention + momentumHow much louder the ticker is than the rest of today's board.
Confidenceconfidence = 1 − 1/(1 + breadth)Damps a name that only one source reports: it loses half a point.
Scorescore = Σₖ Wₖ·termₖ − (1 − confidence); W: attention 1, engagement 0.5, momentum 1, breadth 0.75, congress 1, anomaly 1.2The rank on the Board: an ordering for attention, not a recommendation.
TABLE III Price, Trend and Risk
QuantityFormulaWhat it is for
Volatilityσ = sd(ln(C_t/C_{t−1}))·√252, over 63 returnsThe annual swing of the price, from the last quarter of closes.
Log fitOLS of ln C on t, giving logSlope and logR²The trend line in log price, and how well it fits.
Shrunken driftμ_A = 252·clamp(logSlope·clamp(R², 0, 1), −0.8/252, 0.8/252)The trend is trusted only as far as the fit is good, and capped at ±80% a year.
RSIRSI = 100 − 100/(1 + avgGain/avgLoss), Wilder's 14-day averagesOverbought at 80 and over, oversold at 20 and under; 70 and 30 are the approaches.
ATRTR = max(H − L, |H − C_prev|, |L − C_prev|); A = (13A + TR)/14The average day's range, gaps included: the unit stops are measured in.
Chandelier stopL_ch = max(H over 22 days) − 3·ATR₂₂A stop hung from the recent high, three average ranges down.
Structural stopmax(0.995·min(L over 10 days), 0.99·SMA₅₀), held 3–10% below S₀A stop just under recent support or the 50-day average.
TABLE IV The One-Year Plan
QuantityFormulaWhat it is for
Quarterly coneS_q(z) = S₀·exp(μ_A·T + z·σ·√T), T = q/4, z = −2…2The bands on the chart: where the price can plausibly be at each quarter.
T₁ certainT₁ = max(1.02·S₀, S₀·e^{0.5·σ√0.25})The first target: half a quarter's swing above the price, and at least 2%.
T₂ the peakT₂ = clamp(peak, 1.01·T₁, S₀·e^{1.5σ_H}), σ_H = σ·√(Q/4)The main target, at the strongest resistance the plan can see.
T₃ the runnerT₃ = clamp(max(F₁.₆₁₈, S₀·e^{2σ_H}), 1.02·T₂, 3·S₀)What the last tranche rides for, under a trailing stop.
Touch probabilityP_hit = Φ((−x + νT)/(σ√T)) + e^{2νx/σ²}·Φ((−x − νT)/(σ√T)), x = ln(B/S₀)The chance a level is touched at any time within the horizon.
Target before stopP_up = (1 − e^{−θa})/(e^{θb} − e^{−θa}), a = ln(S₀/L), b = ln(H/S₀), θ = 1 − 2μ/σ²Which side of the bracket order is likely to fill first.
Bracket valueP_be = loss/(win + loss); EV = P_up·win − (1 − P_up)·loss; Kelly = EV/winBreak-even odds, expected value and the Kelly fraction of one trade.
Half-Kelly ceilingf½ = clamp(Kelly/2, 0, 1)·100%The most of the account a trade could justify: shown as a ceiling, never as a size.
TABLE V BUY NOW
QuantityFormulaWhat it is for
BUY-NOW score50 + 50(stack/100 − ½) + 30(passed/8 − ½) + 15·heat + 20(RS/10 − ½) + 20(pos₅₂ − ½) + …, clamped 0–100The Action rating: averages in order, the trend template, relative strength and the 52-week position in one number.
EdgeedgePts = (P_up − P_be)·100, from the entry to T₂ against the stopHow much better than break-even an entry's odds are.
Good entryvalid ∧ edgePts > 0 ∧ f½ > 0An entry worth showing: positive edge and a Kelly ceiling above zero.
BUY labelthe first good entry of market → pullback → breakoutBUY NOW, BUY THE PULLBACK or BUY THE BREAKOUT; none good gives WAIT or PASS, and earnings within a week give WAIT.
TABLE VI Sizing
QuantityFormulaWhat it is for
Sharesshares = ⌊E·r/100 ÷ (p − L_fill)⌋, capped at ⌊E/p⌋ and ⌊E·f½/100 ÷ p⌋Size from the loss you accept at the stop's real fill, never above half-Kelly.
Cost and lossnotional = shares·p; lossAtStop = shares·(p − L_fill)What the order costs, and what it loses if the stop fills.
TABLE VII Rate-Limited Fetching
QuantityFormulaWhat it is for
Jittered gapgap = max(1000 ms, m·(1 + j)), j ~ U[−0.2, 0.2]Requests are spaced irregularly, so the desk never polls like a clock.
Minimum intervalfire only when now − lastFire ≥ mEach source's floor between requests: Yahoo 15 s, SEC 250 ms.
Cool-downcd = min(cd_max, cd_base·2^{k−1}), k resets on successBack off by doubling after each refusal, up to a cap.
Budget reserveR = ⌈0.1·budget⌉; background work stops at used ≥ B − RA tenth of every hourly and daily budget is kept for what you asked for.
Market-freshclosed: fresh iff fetched ≥ last settle; open: fresh iff now − fetched < TTLA price fetched after the close is final until the next open, so nothing is fetched twice.

Pictures

Fig. 1. The TrendCatcher desk: a ranked board of tickers in a cream terminal theme

Fig. 2. The Board: ranked by attention and disclosure, with grade, conviction and score; the Action column is a separate, descriptive read with no weight in the rank

Fig. 3. Interrogate on AMD after a refresh: the instrumented chart with its cone, stop and three targets, and the plan as cards

Fig. 4. The final checklist and the verdict: the person's confidence against the desk's evidence

Fig. 5. The Morning's Board step: SPY reads BUY NOW, with each entry's edge against its breakeven

Fig. 6. SPY planned over four quarters at Greed 30, with every target derived step by step

Fig. 7. The order as a task, sized from a 0.5% risk budget on a demo account; the desk sends nothing

Fig. 8. After a simulated fill, the Position card reads shares, basis and account from the ledger

Fig. 9. The Guide: the desk's manual and glossary, inside the application

Fig. 10. The volatility card