A Multi-Signal Quantitative Market Intelligence CLI for Statistical Anomaly Detection and Regime Analysis
June 2025 - August 2025
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 also 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 (and many others, admittedly) was actually planted during my work on DermEquity, specifically the methodology of using changes in worst-case underdiagnosis gap to detect bias-amplifying images in a dataset. It's safe to say that the overall framework from the previous example (compute a rolling mean, measure how many standard deviations the current observation is from that mean, flag outliers) is characteristic of anomaly detection, which has direct application to finance.
This prompted a question: how can you build a tool that analyzes financial markets the way a quant hedge fund analyst would? How does the average person know that something unusual is happening, and whether the broader economic environment supports/contradicts the signal?
What ensued was a couple months of self-directed learning/dev across quant finance, macroeconomics, and statistical modeling, culminating in the birth of NEXUS: a Node.js CLI that fuses 4 independent signal domains into 1 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 performs comparable to 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 sec, NEXUS produces a full report covering 4 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.
Why is this cool, you ask? Well, 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 precise understanding of the underlying financial concepts, making this system educationally as much as professionally relevant.
For any of you hooligans who want the full tech details 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 4 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 4 pipelines independently and fuses them into a single Market Intelligence Score (MIS) from 0-100, w/ weighted contributions from each domain. Every reading is also translated into plain English, because junior analysts would probably get fired if they regurgitate numbers at their boss.
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 NEXUS, 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 learning concepts on YouTube and 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 actually work with raw prices. They work with returns, which are basically the percent change from one period to the next. The reason is stationarity- raw prices trend upward over time, meaning their stat 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-yr and 10-yr U.S. Treasury yields has inverted before every single U.S. recession since 1955, without exception. The mechanism is interesting: 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 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 good 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). Of course, the gap I identified was that no open-source tool combines technical, macro, sentiment, and cross-asset signals with interpretable plain-English output.
The NEXUS system has 4 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 4 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.
If you're curious code geek, here you go: github.com/axshoe/nexus
This was the phase I found most challenging, and not that I horrendously suck at math or anything. Implementing every formula from scratch was a bit of head-scratcher, but I stand by my decision. Like my Dad always says, building things from the ground-up, whether an existing solution or a new one, is the only real way of guaranteeing true understanding.
The RSI implementation revealed a subtle trap. The Wikipedia formula looks straightforward, but the correct implementation actually uses Wilder's smoothing method, a modified exponential moving average, rather than just a simple rolling mean. The 2 approaches produce noticeably different results. I verified my implementation against known RSI values from multiple sources before trusting it. Lesson: in quant finance, implementation details matter greatly.
The z-score anomaly detection required careful handling of the window parameter. Too short (5-10 days) produces too many false positives, and too long (60+ days) smooths away actual regime shifts. 20 days emerged as a reasonable default for return Z-scores, which does follow literature conventions.
The backtesting was the most fun 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 quant finance, and acknowledging that is I think much better than pretending a backtest is a performance guarantee.
It's always goose-bump-inducing to seeing your work come together for the first time. Running NEXUS on live data was no different.
A sample AAPL analysis on Jan 2, 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.
Here's a few things I've learned from building NEXUS:
On overfitting and intellectual honesty: the backtesting engine was the most humbling for me. Pretty much every strategy I implemented looked promising on paper. The RSI mean-reversion approach (buy oversold, sell overbought) seemed obviously correct, yet the backtest frequently disagreed. In strong trending markets, "oversold" just means the trend is accelerating downward, and buying into it is exactly wrong. The hybrid strategy outperformed not because it was smarter, but because requiring 2 independent indicators to agree before entering a trade filtered out much noise that destroyed the single-indicator approaches.
This forced a real reckoning with a concept called overfitting: when you choose strategy parameters by looking at historical data, the parameters are by definition tuned to that history. They will not generalize. Every backtest in financial existence suffers from this to some degree, and most tools that show you backtests don't tell you this. I decided NEXUS would, wherein the output explicitly acknowledges the limitation. As I've grown older, I've developed little patience for systems that dress up historical convictions as future insights.
On the Sharpe ratio and how professionals think: before this project, I would've likely evaluated any strategy purely by its return. The Sharpe ratio permanently changed how I think about performance. Return without risk context is almost meaningless. A strategy that makes 60% but swings 40% down along the way is not a good strategy for a human being who will panic and exit at the bottom. The Sharpe ratio captures this. So does the Sortino ratio, which I implemented separately because I found it more defensible: penalizing only downside volatility, not the upside kind that investors actually want.
On Node.js and systems architecture: on the engineering side, NEXUS was my most mature Node proj to date. Designing the separation between data ingestion, analysis, fusion, and display as distinct layers, rather than one large function, made the system convenientally debuggable in many ways my earlier projects were not.
I also became comfortable w/ asynchronous JavaScript patterns at a level I hadn't been before. Fetching from 4 independent APIs in parallel using Promise.all, handling partial failures gracefully so that a FRED outage does not crash the entire analysis, and designing the system to degrade gracefully are good production habits, imo.
On finance as a field: I didn't quite expect to find quantitative finance so rich (pun intended). In fact, I expected it to be rather drier than pantyhose. The yield curve inverting before every recession since 1955 is one of the more interesting regularities I have encountered in any field. Additionally, what I find most superb about NEXUS is not what it can tell you, but what it refuses to- a neutral MIS of 50 (which from an objective lens, might look like a failure) shows 4 domains in disagreement, no high-conviction direction available, and the integrity to not manufacture verdicts. Most tools in any field are built to produce outputs, not to distinguish between knowing something and not knowing it.
NEXUS represents something I did not expect when I started: the awakening of my finance bro alter ego.
Just kidding. Not really.
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.
Edit (March 2026): This project is open source at github.com/axshoe/nexus.