Qoc

Sector rotation

Rank sectors by relative strength, identify rotation opportunities, and let the agent propose rebalancing trades aligned with current momentum.


The sector rotation capability computes relative strength scores across a configurable universe of sector proxies, produces a ranked table of current momentum leaders and laggards, and surfaces rebalancing opportunities for the agent to evaluate.

How relative strength is computed

Relative strength is computed by comparing the price performance of each sector proxy (typically an ETF tracking that sector) against the broad market benchmark over a set of lookback windows. The default windows are 1 month, 3 months, and 6 months. Each sector receives a composite score that is a weighted average of its percentile rank across all windows.

The resulting score is normalized to a 0–100 scale. A score above 60 indicates the sector is outperforming on a relative basis; below 40 indicates underperformance. The agent uses these scores to identify where momentum is concentrated and where capital may be better deployed.

Sample sector rotation output

RankSectorProxy1M perf3M perf6M perfRS score
1TechnologyXLK+4.2 %+11.8 %+18.3 %82
2IndustrialsXLI+3.1 %+8.4 %+14.1 %74
3FinancialsXLF+2.8 %+7.9 %+12.6 %71
4Health CareXLV+1.4 %+4.2 %+9.8 %62
5Consumer Disc.XLY+0.9 %+2.7 %+6.1 %54
6Consumer Stap.XLP-0.3 %-1.1 %+2.4 %40
7UtilitiesXLU-1.2 %-3.4 %-2.8 %29
8Real EstateXLRE-2.1 %-5.6 %-7.3 %18
9EnergyXLE-2.8 %-7.1 %-10.2 %12
10MaterialsXLB-3.4 %-8.9 %-12.7 %8

MCP tool call: sector_rotation

Request a full sector ranking with rebalancing suggestions
json
// Tool call
{
  "tool": "sector_rotation",
  "input": {
    "benchmark": "SPY",
    "lookbacks_days": [21, 63, 126],
    "weights": [0.25, 0.35, 0.40],
    "top_n": 3,
    "suggest_rebalance": true,
    "current_allocations": {
      "XLK": 0.18,
      "XLE": 0.15,
      "XLU": 0.12
    }
  }
}

// Abbreviated result
{
  "ranked_sectors": [...],
  "top_sectors": ["XLK", "XLI", "XLF"],
  "bottom_sectors": ["XLB", "XLE", "XLRE"],
  "rebalance_suggestions": [
    {
      "action": "reduce",
      "symbol": "XLE",
      "current_weight": 0.15,
      "suggested_weight": 0.05,
      "reason": "RS score 12 — persistent underperformance across all lookbacks."
    },
    {
      "action": "reduce",
      "symbol": "XLU",
      "current_weight": 0.12,
      "suggested_weight": 0.04,
      "reason": "RS score 29 — defensive rotation signal in a risk-on tape."
    },
    {
      "action": "increase",
      "symbol": "XLI",
      "current_weight": 0.00,
      "suggested_weight": 0.10,
      "reason": "RS score 74 — industrials entering top-quartile momentum."
    }
  ]
}

Rebalancing suggestions are proposals, not orders

The rebalance_suggestions array from the tool is advisory. The agent uses it as input to draft order proposals in orders/pending/, which you review and approve through the standard flow. No order is submitted automatically based on sector rotation output alone.

How the agent uses rotation data

A typical agent workflow using sector rotation: the agent calls sector_rotation to get the current ranking, reads the current portfolio allocations from the UTA snapshot, computes the delta between current and target sector weights (based on your mandate), and writes one or more order proposals for the sectors that are most misaligned.

You can set sector weight bounds in desk.toml under [mandate] so the agent knows the maximum and minimum allocation it is allowed to propose for any sector. Guards also enforce these bounds as hard limits at order submission time.

Schedule weekly rotation checks

Add a schedule file to schedules/ that runs a sector rotation task every Monday before market open. The agent will produce a fresh ranking, compare it against current allocations, and drop any rebalancing proposals into orders/pending/ for your review at the start of the week.