Qoc

Technical analysis

Compute SMA, EMA, RSI, MACD, ATR, and other indicators over locally cached OHLCV bars; surface actionable signals for the agent to act on.


The technical_analysis tool computes a configurable set of price-based indicators and signals directly from the OHLCV bars stored in the workspace, returning structured output the agent can reason over without making any external API call.

How it works

When you call technical_analysis, the MCP server reads the relevant OHLCV bar files from research/prices/bars/ for the requested symbol and resolution, runs the selected indicators against the full available history, and returns the most recent computed values alongside a signals array summarizing any actionable conditions.

Indicators are computed in-process using the local bar data — no provider API call is made at tool invocation time. If the bars for the requested symbol and resolution are not yet in the workspace, the tool triggers a background data pull from your configured provider and returns a data_pending status with an estimated ready time.

Supported indicators

IndicatorKey parametersDescription
SMAperiod (e.g., 20, 50, 200)Simple moving average of close price over N bars.
EMAperiod (e.g., 12, 26)Exponentially weighted moving average; more weight on recent bars.
RSIperiod (default 14)Relative Strength Index; values above 70 or below 30 are flagged in signals.
MACDfast, slow, signal (default 12/26/9)Moving Average Convergence Divergence line, signal line, and histogram.
ATRperiod (default 14)Average True Range; used for volatility-scaled position sizing.
Bollinger Bandsperiod, std_dev (default 20/2)Upper, middle, and lower bands around SMA; band width and %B value returned.
VWAPsession (daily or rolling)Volume-weighted average price; daily reset or rolling window.
OBVOn-Balance Volume; cumulative volume signed by price direction.

Tool call and result

MCP tool: technical_analysis — example with signals
json
// Tool call
{
  "tool": "technical_analysis",
  "input": {
    "symbol": "SPY",
    "resolution": "1d",
    "indicators": ["sma", "rsi", "macd", "atr"],
    "sma_periods": [50, 200],
    "rsi_period": 14,
    "macd": { "fast": 12, "slow": 26, "signal": 9 },
    "atr_period": 14
  }
}

// Tool result
{
  "symbol": "SPY",
  "resolution": "1d",
  "as_of": "2026-07-04",
  "close": 541.28,
  "indicators": {
    "sma_50":    538.14,
    "sma_200":   512.67,
    "rsi_14":    58.3,
    "macd_line": 4.72,
    "macd_signal": 3.91,
    "macd_hist": 0.81,
    "atr_14":    7.43
  },
  "signals": [
    {
      "name": "golden_cross",
      "description": "SMA-50 is above SMA-200 (bullish trend structure).",
      "strength": "confirmed"
    },
    {
      "name": "macd_bullish_crossover",
      "description": "MACD histogram turned positive 3 bars ago.",
      "strength": "recent"
    }
  ]
}

ATR for position sizing

The ATR value is particularly useful when the agent is computing position size. A common approach is to size so that 1 ATR of adverse movement equals a fixed percentage of equity (e.g., 0.5%). Pass the ATR from technical_analysis directly into your sizing logic or ask the agent to incorporate it in the order proposal rationale.

Using signals

The signals array in the tool result is a curated list of named conditions derived from the computed indicator values. Each signal has a name, a human-readable description, and a strength field (confirmed, recent, warning, or divergence). The agent uses these signals to structure its reasoning rather than parsing raw numbers.

Signals are opinionated by design — they encode common technical interpretations (e.g., RSI above 70 flagged as overbought_warning). If you want the raw numbers only, set include_signals: false in the tool input.

Request multi-symbol analysis in one call

Pass a symbols array instead of a single symbol to analyze multiple instruments in parallel. The tool returns one result object per symbol in the same response. This is efficient when comparing sector ETFs or screening a watchlist for momentum conditions.