explaingit

jackson-video-resources/markov-hedge-fund-method

120Python

TLDR

This repository is the companion code for the first video in a quant trading series.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

This repository is the companion code for the first video in a quant trading series. It packages a single analysis idea as a Claude Code plugin so that a user can install it with two slash commands and then ask Claude in plain English to run it against any asset. The framework was designed by someone named Roan, and the repo owner is the person installing it on camera. The analysis is a Markov regime detector. For a given price series it labels each day as Bull, Bear, or Sideways based on rolling returns over a configurable window with a default of 20 days and plus or minus 5 percent. From that history it builds a 3 by 3 transition matrix using maximum likelihood, raises the matrix to powers to forecast several steps ahead, and computes the long-run stationary distribution. It then emits a signed signal equal to the probability of bull minus the probability of bear, runs a walk-forward backtest without lookahead and reports Sharpe ratio and maximum drawdown, and can optionally fit a Hidden Markov Model using the hmmlearn library. Input data can come from a ticker symbol fetched through yfinance or from a user-supplied CSV with a date and close column. No API keys or accounts are needed because the dependencies are resolved on first run by uv through PEP 723 inline metadata. The README also offers a zero-trust alternative: a single Markdown prompt file that, when pasted into Claude Code in agent mode, builds the same skill from scratch on the user's own machine, which was the version recorded in the on-camera demo. A bonus folder contains a Pine Script v5 indicator for TradingView that paints the regime ribbon and shows the transition matrix and stationary distribution on a chart. License is MIT.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.