tradeblocks-mcp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -189,26 +189,28 @@ backtests/
189
189
  ### Core Tools
190
190
  | Tool | Description |
191
191
  |------|-------------|
192
- | `list_backtests` | List all available blocks |
192
+ | `list_backtests` | List all available blocks with summary stats |
193
+ | `get_block_info` | Detailed info for a specific block |
193
194
  | `get_statistics` | Performance metrics (Sharpe, Sortino, drawdown, etc.) |
194
- | `get_trades` | Raw trade data with optional filters |
195
- | `reprocess_block` | Re-parse CSVs and recalculate statistics |
195
+ | `get_strategy_comparison` | Compare strategies within a block |
196
+ | `compare_blocks` | Compare statistics across multiple blocks |
197
+ | `get_trades` | Raw trade data with filtering, sorting, pagination |
196
198
 
197
199
  ### Analysis Tools
198
200
  | Tool | Description |
199
201
  |------|-------------|
200
202
  | `run_walk_forward` | Walk-forward analysis with configurable windows |
201
203
  | `run_monte_carlo` | Monte Carlo simulation with worst-case scenarios |
202
- | `calculate_correlation` | Strategy correlation matrix (Kendall's tau) |
203
- | `get_tail_risk` | VaR, CVaR, and max drawdown analysis |
204
- | `calculate_position_sizing` | Kelly criterion position sizing |
204
+ | `get_correlation_matrix` | Strategy correlation matrix (Kendall, Spearman, Pearson) |
205
+ | `get_tail_risk` | Tail dependence and copula-based risk analysis |
206
+ | `get_position_sizing` | Kelly criterion position sizing |
205
207
 
206
208
  ### Performance Tools
207
209
  | Tool | Description |
208
210
  |------|-------------|
209
211
  | `get_performance_charts` | 16 chart types (equity, drawdown, distribution) |
210
212
  | `get_period_returns` | Returns aggregated by time period |
211
- | `compare_backtest_vs_actual` | Backtest vs live performance comparison |
213
+ | `compare_backtest_to_actual` | Backtest vs live performance comparison |
212
214
 
213
215
  ### Report Builder Tools
214
216
  | Tool | Description |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradeblocks-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for options trade analysis - works with Claude Desktop/Cowork",
5
5
  "author": "David Romeo <davidmromeo@gmail.com>",
6
6
  "type": "module",
@@ -1,285 +0,0 @@
1
- # Option Omega Backtesting Guide
2
-
3
- This skill provides comprehensive guidance for setting up Option Omega backtests that produce clean, analyzable data for TradeBlocks.
4
-
5
- ## Overview
6
-
7
- Option Omega is a backtesting platform for options strategies. TradeBlocks can import its CSV exports for deeper analysis including walk-forward testing, Monte Carlo simulations, and risk metrics.
8
-
9
- ---
10
-
11
- ## Supported Assets & Data
12
-
13
- ### Available Tickers
14
- | Ticker | Notes |
15
- |--------|-------|
16
- | SPY | Full support |
17
- | SPX | Afternoon expirations only (no AM expiries) |
18
- | QQQ | Full support |
19
- | IWM | Full support |
20
- | AAPL | Full support |
21
- | TSLA | Full support |
22
-
23
- ### Historical Data
24
- - **Range**: January 1, 2013 through previous trading day
25
- - **Updates**: Overnight (3-5am ET), available before market open
26
- - **Resolution**: 1-minute OHLC (uses open price for entry/exit signals)
27
- - **Hours**: RTH only (9:30am - 4:00pm ET)
28
-
29
- ### Data Quality Considerations
30
- - Uses **mid-price** calculated from OPRA bid/ask data
31
- - **March 2020**: Extreme volatility may show unusual results
32
- - **Spring 2025**: Similar volatility artifacts
33
- - Calendar days used for DTE calculations (not trading days)
34
-
35
- ---
36
-
37
- ## Strategy Configuration
38
-
39
- ### Pre-Built Strategies
40
- Option Omega offers 16 pre-built strategy templates:
41
- - Iron Condors
42
- - Calendars
43
- - Butterflies
44
- - Various vertical spreads
45
- - And more
46
-
47
- ### Custom Strategies
48
- - Support for up to **8 legs** per backtest
49
- - Each leg: type (call/put), direction (buy/sell), quantity, DTE
50
-
51
- ### Strike Selection Methods
52
-
53
- | Method | Description | Use Case |
54
- |--------|-------------|----------|
55
- | **Delta** | Select by delta value | Most common, adapts to volatility |
56
- | **Percentage OTM** | Target % out-of-the-money | Fixed distance strategies |
57
- | **Fixed Premium** | Nearest strike to target price | Premium-based entries |
58
- | **Strike Offset** | Relative to parent leg | Linked/dependent legs |
59
-
60
- ### Linked Legs
61
- - Child legs can be "tethered" to parent legs
62
- - Maintains consistent width regardless of underlying price
63
- - Use for spreads where leg distance matters
64
-
65
- ### Strike Rounding
66
- - Option to round strikes to nearest multiples
67
- - Improves liquidity matching
68
- - Useful for tickers with wide strike spacing
69
-
70
- ---
71
-
72
- ## Entry Configuration
73
-
74
- ### Entry Timing
75
- - **Window**: 9:32am - 3:59pm ET
76
- - **Resolution**: 1-minute intervals
77
- - Note: Option pricing begins at 9:32am; 9:30am only has underlying data
78
-
79
- ### Entry Frequency
80
-
81
- | Frequency | Description |
82
- |-----------|-------------|
83
- | **Daily** | Every trading day |
84
- | **Weekly** | Select specific weekdays |
85
- | **Monthly** | Select specific dates (1-31) |
86
- | **Specific Dates** | Whitelist of exact dates |
87
-
88
- ### Entry Filters (Optional)
89
-
90
- #### VIX-Based
91
- - VIX level range (min/max)
92
- - VIX overnight movement
93
- - VIX intraday movement
94
- - VIX9D/VIX ratio
95
-
96
- #### Technical Indicators
97
- - **RSI**: 14-day rolling on 1-minute data
98
- - **SMA**: Simple moving average
99
- - **EMA**: Exponential moving average
100
-
101
- #### Price Action
102
- - **Opening Range Breakout (ORB)**: Entry based on first N minutes
103
- - **Gap conditions**: Overnight gap filters
104
- - **Intraday movement**: Price change since open
105
-
106
- #### SqueezeMetrics
107
- - **DIX**: Dark Index
108
- - **GEX**: Gamma Exposure
109
- - **GXV**: Gamma Exposure Volatility
110
-
111
- ---
112
-
113
- ## Exit Conditions
114
-
115
- ### Profit Targets
116
- Three methods available:
117
- 1. **Percentage-based**: % of max profit or premium received
118
- 2. **Fixed dollar**: Specific dollar amount
119
- 3. **Closing order price**: Exact debit/credit to close
120
-
121
- ### Stop Loss Options
122
-
123
- | Type | Description |
124
- |------|-------------|
125
- | **Fixed** | Static stop level |
126
- | **Trailing** | Moves with profit (recalculated or fixed offset) |
127
- | **0-DTE Intra-minute** | SPX/SPY only, sub-minute precision |
128
- | **Per-leg** | Individual leg stops |
129
-
130
- ### Time-Based Exits
131
-
132
- | Method | Description |
133
- |--------|-------------|
134
- | **By DTE** | Close at N days to expiration |
135
- | **Days in trade** | Close after N calendar days |
136
- | **Minutes in trade** | Close after N minutes |
137
-
138
- ### Other Exit Triggers
139
- - Technical indicator signals
140
- - Delta-based (position or individual leg)
141
- - Short strike tested
142
- - Underlying moves specified amount
143
-
144
- ---
145
-
146
- ## Risk Controls ("The Punisher")
147
-
148
- ### Transaction Costs
149
- - **Commissions/Fees**: Per-contract amount
150
- - **Slippage**: Separate settings for entry, exit, and stop loss
151
-
152
- ### Trade Filters
153
- - **Bid-ask spread filter**: Reject trades exceeding threshold (default: 10,000 bps)
154
- - **Min/max entry premium**: Filter by received/paid amounts
155
- - **Short/long premium ratio**: Filter by ratio
156
-
157
- ### Execution Refinements
158
- - **Consecutive hits**: Require 2 intervals at target/stop before exit
159
- - **Cap profits/losses**: Limit fills at specified levels
160
- - **Close on completion**: Auto-close remaining trades at test end
161
-
162
- ### Date Controls
163
- - **Blackout days**: Exclude specific dates from trading
164
- - **Re-entry delays**: Wait period after exits before new trades
165
-
166
- ---
167
-
168
- ## Position Sizing
169
-
170
- ### Capital Controls
171
- - **Starting funds**: Initial account balance
172
- - **Margin allocation %**: Percentage of capital per trade
173
- - **Max open trades**: Simultaneous position limit
174
- - **Max contracts/trade**: Hard cap on contract size
175
-
176
- ### Dynamic Sizing
177
- - Contract count calculated from available capital
178
- - Adjusts based on margin requirements
179
- - Option to ignore margin requirements (requires contract limit)
180
-
181
- ---
182
-
183
- ## Common Issues & Troubleshooting
184
-
185
- ### Why Trades Don't Execute
186
- 1. **Insufficient margin**: Not enough buying power
187
- 2. **Exact DTE filter**: No matching expiration
188
- 3. **Max open trades reached**: Position limit hit
189
- 4. **Strike padlock enabled**: Exact strike not available
190
- 5. **Trades still open at test end**: Check close-on-completion setting
191
-
192
- ### Data Gaps
193
- - Very wide bid-ask spreads may prevent execution
194
- - Check bid-ask filter settings if trades seem to skip
195
-
196
- ---
197
-
198
- ## Exporting for TradeBlocks
199
-
200
- ### Export Steps
201
- 1. Run your backtest in Option Omega
202
- 2. Navigate to **Results → Trade Log**
203
- 3. Click **Export** or **Download CSV**
204
- 4. Save to **Downloads**, **Desktop**, or **Documents** folder
205
- 5. In TradeBlocks: `import_csv` with filename and block name
206
-
207
- ### Expected CSV Columns
208
- Option Omega exports these automatically:
209
- - `Date Opened`, `Time Opened`
210
- - `Date Closed`, `Time Closed`
211
- - `P/L`
212
- - `Strategy`
213
- - `Legs`
214
- - `No. of Contracts`
215
- - `Premium`
216
- - `Opening Price`, `Closing Price`
217
- - `Reason For Close`
218
- - `Opening VIX`, `Closing VIX` (if available)
219
- - `Gap`, `Movement` (if available)
220
- - `Max Profit`, `Max Loss` (if available)
221
-
222
- ### What's Lost in Export
223
- The CSV export loses Option Omega's visual features:
224
- - Trade replay visualization
225
- - VIX/underlying price charts
226
- - Interactive trade log filtering
227
-
228
- TradeBlocks compensates with:
229
- - Walk-forward analysis (overfitting detection)
230
- - Monte Carlo simulations (risk assessment)
231
- - Comprehensive statistics (Sharpe, Sortino, etc.)
232
- - Tail risk analysis (VaR, CVaR)
233
- - Position sizing recommendations (Kelly criterion)
234
-
235
- ---
236
-
237
- ## Best Practices for Clean Backtests
238
-
239
- ### Realistic Settings
240
- 1. **Enable slippage**: At least 0.01-0.02 per contract
241
- 2. **Set commissions**: Match your broker's fees
242
- 3. **Use bid-ask filter**: Reject unrealistic fills
243
- 4. **Enable consecutive hits**: Avoid phantom fills
244
-
245
- ### Avoid Overfitting
246
- 1. Use simple entry/exit rules initially
247
- 2. Avoid excessive filters that "cherry-pick" trades
248
- 3. Run walk-forward analysis in TradeBlocks after import
249
- 4. Compare in-sample vs out-of-sample performance
250
-
251
- ### Consistent Naming
252
- - Use descriptive strategy names in Option Omega
253
- - The `Strategy` column carries through to TradeBlocks
254
- - Enables filtering and comparison by strategy
255
-
256
- ---
257
-
258
- ## TradeBlocks Analysis Workflow
259
-
260
- After importing Option Omega data:
261
-
262
- 1. **Get Statistics**: Basic performance metrics
263
- ```
264
- get_statistics("my-strategy")
265
- ```
266
-
267
- 2. **Walk-Forward Analysis**: Test for overfitting
268
- ```
269
- run_walk_forward("my-strategy")
270
- ```
271
-
272
- 3. **Monte Carlo Simulation**: Risk assessment
273
- ```
274
- run_monte_carlo("my-strategy")
275
- ```
276
-
277
- 4. **Position Sizing**: Kelly criterion recommendation
278
- ```
279
- calculate_position_sizing("my-strategy", account_size)
280
- ```
281
-
282
- 5. **Tail Risk**: VaR and worst-case analysis
283
- ```
284
- get_tail_risk("my-strategy")
285
- ```