Intelligence Tools
Intelligence tools analyze market data (OHLCV bars, options chains, futures curves) to detect actionable patterns and structure.
detect_patterns
Section titled “detect_patterns”Cost: $0.008 | Detect price action patterns from OHLCV bars.
Detects: breakouts, breakdowns, pullbacks, moving average crossovers (SMA 20/50, 50/200, EMA 9/21, MACD, RSI), RSI divergences, price gaps, and consolidation zones.
| Parameter | Type | Required | Description |
|---|---|---|---|
bars | object[] | Yes | OHLCV bars (minimum 35). Each bar: {open, high, low, close, volume} as strings. |
result = client.call_tool( "detect_patterns", bars=[{"open": "150.00", "high": "152.00", "low": "149.50", "close": "151.50", "volume": "5000000"}, ...],)Returns: patterns[] each with type, direction, confirmed, volume_confirmed, strength.
detect_structural_break
Section titled “detect_structural_break”Cost: $0.006 | Detect structural breaks in price distribution.
Compares recent 20 bars vs historical 200 bars across mean return, standard deviation, skewness, and kurtosis. Flags a break when any metric deviates more than 2 standard deviations.
| Parameter | Type | Required | Description |
|---|---|---|---|
bars | object[] | Yes | OHLCV bars (minimum 221). Most recent bar last. |
result = client.call_tool( "detect_structural_break", bars=ohlcv_bars, # 221+ bars)Returns: break_detected, break_type (return_shift, volatility_shift, mean_departure), severity (0 to 1), z_score, rolling_stats.
analyze_trend_structure
Section titled “analyze_trend_structure”Cost: $0.006 | Analyze trend structure using Bollinger Bands and ATR.
| Parameter | Type | Required | Description |
|---|---|---|---|
bars | object[] | Yes | OHLCV bars (minimum 21). Most recent bar last. |
result = client.call_tool( "analyze_trend_structure", bars=ohlcv_bars, # 21+ bars)Returns: phase (EXPANSION, COMPRESSION, TRANSITION), squeeze_state (NONE, FORMING, ACTIVE, FIRING), momentum_shift (ACCELERATING, DECELERATING, STEADY), expansion_rate, atr_trend.
A squeeze firing means a volatility explosion is imminent.
calculate_indicators
Section titled “calculate_indicators”Cost: $0.004 | Calculate technical indicators from OHLCV bars.
Supports: SMA, EMA, RSI, MACD, Bollinger Bands, ATR.
| Parameter | Type | Required | Description |
|---|---|---|---|
bars | object[] | Yes | OHLCV bars. Most recent bar last. |
indicator | string | Yes | One of: "sma", "ema", "rsi", "macd", "bb", "atr". |
period | int | No | Indicator period. Defaults: SMA/EMA=20, RSI=14, ATR=14, BB=20. |
# RSIrsi = client.call_tool( "calculate_indicators", bars=ohlcv_bars, indicator="rsi", period=14,)
# MACDmacd = client.call_tool( "calculate_indicators", bars=ohlcv_bars, indicator="macd",)
# Bollinger Bandsbb = client.call_tool( "calculate_indicators", bars=ohlcv_bars, indicator="bb", period=20,)Returns vary by indicator:
- SMA/EMA:
value - RSI:
value(0 to 100) - MACD:
macd_line,signal_line,histogram - BB:
upper,middle,lower,bandwidth - ATR:
value
analyze_price_structure
Section titled “analyze_price_structure”Cost: $0.006 | Detect support/resistance, swing points, and consolidation zones.
| Parameter | Type | Required | Description |
|---|---|---|---|
bars | object[] | Yes | OHLCV bars (minimum 21). Most recent bar last. |
result = client.call_tool( "analyze_price_structure", bars=ohlcv_bars,)Returns: nearest_support, nearest_resistance, support_distance, resistance_distance, range_position (0 to 1), dynamic_levels (SMA 20/50/200), consolidation_zones[].
analyze_correlations
Section titled “analyze_correlations”Cost: $0.008 | Multi-symbol correlation analysis.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols_data | object[] | Yes | Array of {symbol, bars} objects. Minimum 2 symbols, 10+ bars each. |
result = client.call_tool( "analyze_correlations", symbols_data=[ {"symbol": "AAPL", "bars": aapl_bars}, {"symbol": "MSFT", "bars": msft_bars}, {"symbol": "GOOGL", "bars": googl_bars}, ],)Returns: correlation_matrix, correlated_clusters, correlation_breakdowns, concentration_risk.
analyze_liquidity
Section titled “analyze_liquidity”Cost: $0.004 | Analyze market liquidity from volume data.
| Parameter | Type | Required | Description |
|---|---|---|---|
bars | object[] | Yes | OHLCV bars (minimum 2). Most recent bar last. |
period | int | No | Lookback period for averages (default 20). |
result = client.call_tool( "analyze_liquidity", bars=ohlcv_bars,)Returns: condition (NORMAL, THINNING, STRESSED, SPIKE), relative_volume, volume_trend, volume_percentile, participation_rate, spike_detected.
analyze_greeks
Section titled “analyze_greeks”Cost: $0.006 | Analyze options Greeks and risk exposure.
| Parameter | Type | Required | Description |
|---|---|---|---|
positions | object[] | Yes | Options positions with strike, type, quantity, delta, gamma, theta, vega. |
Returns: total_delta, total_gamma, total_theta, total_vega, delta_dollars, gamma_risk, theta_decay_daily, vega_exposure.
analyze_iv_surface
Section titled “analyze_iv_surface”Cost: $0.008 | Analyze implied volatility surface structure.
| Parameter | Type | Required | Description |
|---|---|---|---|
options_chain | object[] | Yes | Options with strike, expiry, iv, type (call/put). |
underlying_price | string | Yes | Current underlying price. |
Returns: iv_skew, term_structure, smile_shape, atm_iv, put_call_skew, surface_anomalies.
analyze_futures_curve
Section titled “analyze_futures_curve”Cost: $0.006 | Analyze futures term structure.
| Parameter | Type | Required | Description |
|---|---|---|---|
contracts | object[] | Yes | Futures contracts with expiry, price, volume, open_interest. |
spot_price | string | Yes | Current spot/cash price. |
Returns: curve_shape (CONTANGO, BACKWARDATION, FLAT), basis, roll_yield, convenience_yield, term_structure_slope.
analyze_options_flow
Section titled “analyze_options_flow”Cost: $0.006 | Analyze options order flow for directional signals.
| Parameter | Type | Required | Description |
|---|---|---|---|
trades | object[] | Yes | Recent options trades with strike, type, side, size, premium. |
Returns: net_call_premium, net_put_premium, put_call_ratio, unusual_activity[], large_trades[], directional_bias.