You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,17 @@
7
7
A high-performance options and stock backtesting engine exposed as an [MCP](https://modelcontextprotocol.io/) server. Connect it to Claude Desktop, Claude Code, or any MCP-compatible client and backtest strategies, optimize parameters, and analyze price patterns through natural language.
8
8
9
9
> [!NOTE]
10
-
> This project is currently in a pre-release state. We are iterating quickly, which means breaking changes to the API and configuration may occur without prior notice. Use in production environments at your own risk.
10
+
> This project is under active development. Breaking changes to the API and configuration may occur between minor versions. Pin to a specific release tag for stability.
11
11
12
12
## What You Can Do
13
13
14
14
### Backtest Options Strategies
15
15
16
-
Run event-driven simulations across 31 built-in options strategies — from simple singles to multi-leg iron condors, butterflies, calendars, and diagonals. Full position management with stop-loss, take-profit, max-hold exits, and 5 dynamic position sizing methods.
16
+
Run event-driven simulations across 32 built-in options strategies — from simple singles to multi-leg iron condors, butterflies, calendars, diagonals, and stock-leg strategies (covered calls, protective puts). Full position management with stop-loss, take-profit, max-hold exits, and 5 dynamic position sizing methods.
17
17
18
18
```
19
19
"Backtest an iron condor on SPY with $100k capital, 30-delta wings, and a 50% stop loss"
20
+
"Run a covered call strategy on AAPL with a 30-delta short call"
20
21
"Run a short put selling strategy with RSI < 30 as the entry filter"
21
22
```
22
23
@@ -47,6 +48,16 @@ Walk-forward analysis with rolling train/test windows and permutation testing fo
47
48
"Is this backtest result statistically significant or just luck?"
48
49
```
49
50
51
+
### Filter by Market Regime
52
+
53
+
Gate entries using Hidden Markov Model regime detection. Fit on historical data, classify forward in real-time (no look-ahead bias), and only trade in favorable regimes.
54
+
55
+
```
56
+
"Only enter covered calls when SPY is in a bullish HMM regime"
57
+
"Skip trades during bearish regimes: hmm_regime(3, 5) != bearish"
58
+
"Combine regime with technicals: hmm_regime(2, 5) == bullish and rsi(close, 14) < 30"
59
+
```
60
+
50
61
### Analyze Price Patterns
51
62
52
63
Discover seasonality and time-based patterns with aggregate statistics, distribution analysis, correlation matrices, rolling metrics, and regime detection.
@@ -59,7 +70,7 @@ Discover seasonality and time-based patterns with aggregate statistics, distribu
59
70
60
71
### Build Custom Signals
61
72
62
-
Create entry/exit signals with a formula DSL covering 35+ functions (momentum, trend, volatility, volume, derived stats). Save, rename, and reuse signals across sessions.
73
+
Create entry/exit signals with a formula DSL covering 67 functions (momentum, trend, volatility, volume, regime, derived stats). Save, rename, and reuse signals across sessions.
63
74
64
75
```
65
76
"Create a signal that fires when RSI < 30 and price is below the lower Bollinger Band"
@@ -71,7 +82,7 @@ Create entry/exit signals with a formula DSL covering 35+ functions (momentum, t
71
82
| Tool | Description |
72
83
|------|-------------|
73
84
|`list_symbols`| Discover available symbols in the data cache |
74
-
|`list_strategies`| Browse all 31 built-in options strategies with leg definitions |
85
+
|`list_strategies`| Browse all 32 built-in options strategies with leg definitions |
|`generate_hypotheses`| Auto-scan for statistically significant patterns with FDR correction |
89
100
|`portfolio_backtest`| Run multiple stock strategies as a weighted portfolio |
90
101
|`drawdown_analysis`| Full drawdown distribution with episode tracking and Ulcer Index |
@@ -133,9 +144,9 @@ To change the cache directory, set `DATA_ROOT` in the config:
133
144
134
145
## Key Capabilities
135
146
136
-
### 31 Options Strategies
147
+
### 32 Options Strategies
137
148
138
-
Singles, verticals, straddles, strangles, butterflies, condors, iron condors/butterflies, calendars, and diagonals — with multi-expiration support for calendar and diagonal spreads.
149
+
Singles, verticals, straddles, strangles, butterflies, condors, iron condors/butterflies, calendars, diagonals, and stock-leg strategies (covered call, protective put) — with multi-expiration support for calendar and diagonal spreads.
139
150
140
151
### 4 Slippage Models
141
152
@@ -145,9 +156,9 @@ Mid, spread (bid/ask worst-case), liquidity-based (volume-scaled), and per-leg f
145
156
146
157
Fixed quantity, fixed fractional, risk per trade, Kelly criterion, and volatility targeting.
147
158
148
-
### 40+ Built-in Signals
159
+
### 67 Built-in Signals
149
160
150
-
RSI, MACD, Stochastic, Bollinger Bands, Keltner Channels, Supertrend, Aroon, ATR, OBV, MFI, IV Rank/Percentile, and more — plus AND/OR/NOT combinators and cross-symbol signals (e.g., VIX as a filter for SPY trades).
161
+
RSI, MACD, Stochastic, Bollinger Bands, Keltner Channels, Supertrend, Aroon, ATR, OBV, MFI, IV Rank/Percentile, HMM regime filter, and more — plus AND/OR/NOT combinators and cross-symbol signals (e.g., VIX as a filter for SPY trades).
151
162
152
163
### Formula DSL
153
164
@@ -158,10 +169,11 @@ close > sma(close, 50) and rsi(close, 14) < 30
158
169
macd_hist(close) > 0 and rel_volume(volume, 20) > 2.0
159
170
consecutive_down(close) >= 3 and volume > sma(volume, 20) * 1.5
160
171
iv_rank(iv, 252) > 50 and bbands_lower(close, 20) > close
172
+
hmm_regime(3, 5) == bullish and rsi(close, 14) < 30
161
173
day_of_week() == 1 and pct_change(close, 1) < -0.005
0 commit comments