A Multi-Signal Quantitative Market Intelligence CLI for Statistical Anomaly Detection and Regime Analysis
January 2026 - April 2026
I have zero background in finance. I did not know what a stock was beyond the vague cultural osmosis of watching adults panic during market crashes. I certainly did not know what a Sharpe ratio was, what the yield curve meant, or why anyone would care about something called the "CBOE Volatility Index."
However, I am a finance bro in spirit.
So naturally, I decided to build a quantitative market intelligence system.
The seed of this project was actually planted during my work on DermEquity, specifically the methodology of using statistical z-scores to detect bias-amplifying images in a dataset. At some point it occurred to me that the exact same framework (compute a rolling mean, measure how many standard deviations the current observation is from that mean, flag outliers) is the foundation of anomaly detection in financial markets. The math is identical. The domain is completely different.
This prompted a question: what would it look like to build a system that analyzes financial markets the way a quantitative hedge fund analyst would, not just showing you RSI and calling it analysis, but actually asking whether something unusual is happening and whether the broader economic environment supports or contradicts the signal?
What ensued was three months of self-directed learning across quantitative finance, macroeconomics, and statistical modeling, culminating in NEXUS: a Node.js CLI that fuses four independent signal domains into one interpretable Market Intelligence Score. Read on.
Cheers,
Angie X.
What is NEXUS?
NEXUS is a computer program you run in a command-line terminal that acts like a junior analyst at a hedge fund. You type in the ticker symbol of any publicly traded company, like Apple (AAPL) or Tesla (TSLA), and in about 5 seconds, NEXUS produces a full research report covering four completely different angles on that company’s stock.
Unlike typical financial apps that only show charts or a few indicators, NEXUS pulls real data from multiple sources simultaneously: live stock prices and company news, Federal Reserve economic data, a real-time market sentiment index, and cryptocurrency prices used as a global risk gauge. It then combines all of this information into a single Market Intelligence Score (MIS) from 0 to 100. A high score indicates broad bullish signals, a low score shows warning signals, and a neutral score means the signals are mixed—valuable insight on its own.
Why is this cool?
Everything in NEXUS is built from scratch, including the math behind indicators like RSI, MACD, Bollinger Bands, and risk metrics like the Sharpe ratio. I didn't use any pre-made financial libraries. Thus, my approach ensures a deep, precise understanding of the underlying financial concepts, making the system both educational and professionally relevant.
For any of you hooligans who want the full tech details, project guide with all formulas, and source explanations, it's all available in the PDF embedded below.
The existing landscape of retail financial analysis tools falls into two traps. The first trap is the price dashboard: tools that show you a chart with RSI and MACD overlays and call it analysis. They never ask whether the broader environment supports the signal. An RSI reading of 28 means something completely different when the Federal Reserve is cutting rates versus when the yield curve is inverted and the VIX is spiking. The first category of tools cannot tell you this.
The second trap is the macro-only tool: platforms that show you CPI data and yield curve charts but have no mechanism to connect those readings to specific assets.
NEXUS bridges both. The core idea is that equity prices are driven by four independent forces simultaneously. Technical momentum captures the internal price structure of the asset itself (RSI, MACD, Bollinger Bands, moving average alignment), and these dominate short-term price action. The macroeconomic regime covers the broader environment set by the Federal Reserve and bond markets (yield curve shape, VIX level, inflation, employment), and these dominate medium-term directional bias. Sentiment quantifies how investors feel, separate from fundamentals (news flow, the Fear and Greed Index), which is real, measurable, and often contrarian at extremes. Cross-asset signals use Bitcoin and Ethereum as risk-on/risk-off proxies, particularly relevant post-2020 when crypto correlation with equities increased dramatically.
NEXUS runs all four pipelines independently and fuses them into a single Market Intelligence Score (MIS) from 0 to 100, with weighted contributions from each domain. The output is not just numbers. Every reading is translated into plain English, the way a junior analyst would brief a portfolio manager.
Project Objective: Build a quantitative market intelligence CLI that provides institutional-grade multi-signal analysis using only free, publicly available data sources, with all statistical formulas implemented from scratch.
Prior to this project, my finance knowledge could be generously described as "why yes, the stock market exists." Consequently, I spent the first week or so doing scant nothin' but eye-perusing: academic papers on momentum signals, behavioral finance research by Shiller and Thaler, the original Wilder (1978) paper introducing RSI, Bollinger's work on adaptive volatility envelopes, and a substantial amount of Federal Reserve documentation on yield curve dynamics.
A few concepts quite surprised me. The first was that quants never work with raw prices. They work with returns, which are the percentage change from one period to the next. The reason is stationarity: raw prices trend upward over time, meaning their statistical properties change constantly. Returns do not. This seems obvious in retrospect but is never mentioned in casual financial media.
The second surprise was the yield curve inversion signal. The spread between 2-year and 10-year U.S. Treasury yields has inverted before every single U.S. recession since 1955, without exception. The mechanism is elegant: banks borrow short-term and lend long-term. When short rates exceed long rates, that spread goes negative, lending becomes unprofitable, banks pull back on credit, and the economy contracts. This signal is freely available from the Federal Reserve's public API and is essentially invisible to most retail investors.
The third was the Sharpe ratio, which reframes strategy evaluation entirely. A strategy that returns 80% but swings wildly may be worse than one that returns 25% smoothly. Risk-adjusted thinking is the foundation of professional portfolio management, and it is almost completely absent from retail financial discourse.
I also spent time studying the architecture of existing tools: Quiver Quantitative (congressional trading tracker, alternative data), SentimenTrader (sentiment-focused with 2800+ indicators), Bloomberg Terminal (the institutional standard at $24,000 per year). The gap I identified was that no open-source tool combines technical, macro, sentiment, and cross-asset signals with interpretable plain-English output, built by someone who had to learn all the underlying math from scratch.
Before writing a single line of code, I designed the full data pipeline. The system is organized into four layers.
The Data Ingestion Layer lives in src/data/ and has three modules. finnhub.js handles real-time stock quotes, one year of daily price history, company news with sentiment scores, and company profiles (60 API calls per minute, free). fred.js pulls six macroeconomic series from the Federal Reserve: VIX, 10-year Treasury yield, 2-year Treasury yield, Federal Funds Rate, CPI, and unemployment rate. FRED is a public service with unlimited free requests. feargreed.js retrieves the CNN Fear and Greed Index via Alternative.me and Bitcoin/Ethereum prices via CoinGecko, both requiring no API key at all.
The Analysis Layer in src/analysis/ has four modules. technical.js implements RSI with Wilder smoothing, MACD with configurable EMA periods, Bollinger Bands with rolling standard deviation, rolling Z-scores, annualized volatility, ATR, Sharpe ratio, Sortino ratio, and maximum drawdown, all from scratch with no financial libraries. anomaly.js detects eight anomaly types including return outliers (|z| > 2.0), volatility regime shifts, RSI extremes, Bollinger squeeze detection, Bollinger Band breaches, golden/death crosses, volume spikes, and MACD crossover events. macro.js classifies the macroeconomic regime using a four-quadrant framework. backtest.js simulates four trading strategies on historical data and outputs Sharpe ratio, max drawdown, total return, and alpha versus buy-and-hold.
The Fusion Engine in src/engine/signal.js is the novel core of the system. It combines all four domains: MIS = (Technical x 0.40) + (Macro x 0.30) + (Sentiment x 0.20) + (Cross-Asset x 0.10)
The Display Layer in src/display/terminal.js renders the full dashboard using chalk for colors and cli-table3 for formatted tables, with spinner animations and color-coded signal outputs.
This was the phase I found most intellectually rewarding, and most humbling. Implementing every formula from scratch forced genuine understanding.
The RSI implementation revealed a subtle trap. The Wikipedia formula looks straightforward. The correct implementation uses Wilder's smoothing method, a modified exponential moving average, rather than a simple rolling mean. The two approaches produce noticeably different results. I verified my implementation against known RSI values from multiple sources before trusting it. Lesson: in quantitative finance, implementation details matter enormously. Two people implementing RSI can get results differing by several points.
The Z-score anomaly detection required careful handling of the window parameter. Too short (5 to 10 days) produces too many false positives. Too long (60+ days) smooths away genuine regime shifts. Twenty days emerged as a reasonable default for return Z-scores, following conventions in the academic literature.
The backtesting was the most humbling part. The RSI mean-reversion strategy, which seemed obviously correct in theory, dramatically underperforms buy-and-hold on many tickers in strong trending markets, because "oversold" simply means the trend is accelerating downward. The hybrid strategy outperforms because dual confirmation reduces false signals. But even the hybrid's parameters were chosen by looking at historical data, which is a form of overfitting. This is the central methodological challenge in quantitative finance, and acknowledging it openly is more intellectually honest than pretending a backtest is a performance guarantee.
Running NEXUS on live data for the first time was invigorating. A sample AAPL analysis on March 25, 2026 produced a MIS of 50/100 (Neutral/Mixed), with a technical score of 39 (RSI at 66.6 approaching overbought, MACD histogram just turned negative) fighting against a sentiment score of 68 (Fear and Greed at 14, Extreme Fear, which NEXUS interprets as a contrarian bullish signal). The two domains pulling in opposite directions produced a neutral composite, which is itself useful information.
The macro regime read Neutral/Mixed: VIX at 26.9 (elevated market anxiety), yield curve positive at +0.51% (not inverted), Fed Funds at 3.64% (on hold), CPI elevated at approximately 3.2% annualized.
The anomaly engine flagged a real signal: Apple's price was breaking above its upper Bollinger Band, statistically extended, flagged at MEDIUM severity. The backtest found the hybrid strategy best at +7.69% return versus +1.43% buy-and-hold, Sharpe ratio 0.842, max drawdown of only 6.29%. The Fear and Greed reading of 14 was particularly striking because it was a live real-time reading of genuine market anxiety, not demo data.
The Finnhub free tier restricts access to the historical candle endpoint, which I discovered only after the system was fully built. The fix was a graceful fallback: use synthetic price history for technical indicators while using real live data for everything else (quotes, news, FRED macro, Fear and Greed, crypto). The output is still genuinely useful and clearly labeled.
The most important intellectual lesson was about overfitting and the gap between backtests and reality. A backtest that looks good is not evidence a strategy works in real markets. Transaction costs, slippage, bid-ask spreads, and the fundamental fact that you chose parameters by looking at historical data all erode theoretical performance. NEXUS acknowledges this explicitly in its output. Any system that does not is either naive or dishonest.
NEXUS represents something I did not expect when I started: the awakening of my finance bro alter ego.
Perhaps to you all of these concepts - yield curve inversion, behavioral finance, Sharpe v. Sortino - may seem obscenely lifeless at first glance. but if you thought that, you probably wouldn’t be reading this conclusion. Thence, like you, I found all of it technically fascinating.
My mother is an insurance analyst. While NEXUS isn't quite the same thing, I've developed much more sympathy for her through its creation.
More broadly, building NEXUS from zero finance knowledge further reinforced my personal belief that the fastest way to learn a field deeply is to build something in it that requires you to actually understand the fundamental sh*t.
Just my 2 cents. Thanks for reading :)
Cheers,
Angie X.
This project is open source at github.com/axshoe/nexus.