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
| Language | JavaScript (Node.js) |
|---|---|
| Version | 0.6.0 |
| License | MIT |
| Source | Private |
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.
| Quantity | Formula | What it is for |
|---|---|---|
| Attention | attention = Σₛ w·ℓ(n), over every source naming the ticker | How loudly the ticker is named, weighted by how far each source is trusted and softened by the log. |
| Momentum | momentum = sgn(Δsrc)·ℓ(|Δsrc|) + sgn(Δrun)·ℓ(|Δrun|) | Whether the talk is accelerating, against the last 24 hours and against the last run. |
| Breadth | breadth = number of distinct sources naming the ticker | Corroboration: one forum shouting is not the same as three sources agreeing. |
| Congress | congress = ℓ(Σₛ w·(buys − sells)) if positive, else 0 | Net disclosed congressional buying; selling counts as nothing, not as a negative. |
| Anomaly | anomaly = min(4, max(0, (c − μ_c)/σ_c)), c = attention + momentum | How much louder the ticker is than the rest of today's board. |
| Confidence | confidence = 1 − 1/(1 + breadth) | Damps a name that only one source reports: it loses half a point. |
| Score | score = Σₖ Wₖ·termₖ − (1 − confidence); W: attention 1, engagement 0.5, momentum 1, breadth 0.75, congress 1, anomaly 1.2 | The rank on the Board: an ordering for attention, not a recommendation. |
| Quantity | Formula | What it is for |
|---|---|---|
| Volatility | σ = sd(ln(C_t/C_{t−1}))·√252, over 63 returns | The annual swing of the price, from the last quarter of closes. |
| Log fit | OLS 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. |
| RSI | RSI = 100 − 100/(1 + avgGain/avgLoss), Wilder's 14-day averages | Overbought at 80 and over, oversold at 20 and under; 70 and 30 are the approaches. |
| ATR | TR = max(H − L, |H − C_prev|, |L − C_prev|); A = (13A + TR)/14 | The average day's range, gaps included: the unit stops are measured in. |
| Chandelier stop | L_ch = max(H over 22 days) − 3·ATR₂₂ | A stop hung from the recent high, three average ranges down. |
| Structural stop | max(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. |
| Quantity | Formula | What it is for |
|---|---|---|
| Quarterly cone | S_q(z) = S₀·exp(μ_A·T + z·σ·√T), T = q/4, z = −2…2 | The bands on the chart: where the price can plausibly be at each quarter. |
| T₁ certain | T₁ = 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 peak | T₂ = 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 runner | T₃ = clamp(max(F₁.₆₁₈, S₀·e^{2σ_H}), 1.02·T₂, 3·S₀) | What the last tranche rides for, under a trailing stop. |
| Touch probability | P_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 stop | P_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 value | P_be = loss/(win + loss); EV = P_up·win − (1 − P_up)·loss; Kelly = EV/win | Break-even odds, expected value and the Kelly fraction of one trade. |
| Half-Kelly ceiling | f½ = clamp(Kelly/2, 0, 1)·100% | The most of the account a trade could justify: shown as a ceiling, never as a size. |
| Quantity | Formula | What it is for |
|---|---|---|
| BUY-NOW score | 50 + 50(stack/100 − ½) + 30(passed/8 − ½) + 15·heat + 20(RS/10 − ½) + 20(pos₅₂ − ½) + …, clamped 0–100 | The Action rating: averages in order, the trend template, relative strength and the 52-week position in one number. |
| Edge | edgePts = (P_up − P_be)·100, from the entry to T₂ against the stop | How much better than break-even an entry's odds are. |
| Good entry | valid ∧ edgePts > 0 ∧ f½ > 0 | An entry worth showing: positive edge and a Kelly ceiling above zero. |
| BUY label | the first good entry of market → pullback → breakout | BUY NOW, BUY THE PULLBACK or BUY THE BREAKOUT; none good gives WAIT or PASS, and earnings within a week give WAIT. |
| Quantity | Formula | What it is for |
|---|---|---|
| Shares | shares = ⌊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 loss | notional = shares·p; lossAtStop = shares·(p − L_fill) | What the order costs, and what it loses if the stop fills. |
| Quantity | Formula | What it is for |
|---|---|---|
| Jittered gap | gap = 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 interval | fire only when now − lastFire ≥ m | Each source's floor between requests: Yahoo 15 s, SEC 250 ms. |
| Cool-down | cd = min(cd_max, cd_base·2^{k−1}), k resets on success | Back off by doubling after each refusal, up to a cap. |
| Budget reserve | R = ⌈0.1·budget⌉; background work stops at used ≥ B − R | A tenth of every hourly and daily budget is kept for what you asked for. |
| Market-fresh | closed: fresh iff fetched ≥ last settle; open: fresh iff now − fetched < TTL | A 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