Skip to content

Regime Shift Trader

ElizaOS agent that detects regime changes and executes trades via natural language commands. Framework: ElizaOS + TypeScript.

Live Output Preview

If you ran this bot right now, the API would return:

# Live API output — March 12, 2026
Market Regime: Mean-Reverting
Safety Score: 95.6 (HIGH)

Composite Signals:
  BTC: neutral (score: 0.028)\n  ETH: buy (score: 0.236)\n  SOL: buy (score: 0.183)\n  HYPE: strong_buy (score: 0.319)\n
# The bot would use this data to make trading decisions

Complete Source Code

Copy this code, replace YOUR_API_KEY with your key, and run:

// ElizaOS Agent: Trade Regime Shifts
// This agent monitors market regimes and executes trades on transitions

import {{ Agent, Action }} from "@eliza-os/core";

const API_KEY = "YOUR_API_KEY";
const BASE = "https://algotick.dev";

const regimeTrader = new Agent({{
  name: "Regime Shift Trader",
  description: "Monitors HMM regime transitions and trades accordingly",

  actions: [
    new Action({{
      name: "check_regime",
      description: "Check current market regime for all coins",
      handler: async () => {{
        const resp = await fetch(`${{BASE}}/v3/signals/regime?api_key=${{API_KEY}}`);
        const data = await resp.json();
        return data.regimes.map((r: any) =>
          `${{r.coin}}: ${{r.regime_label}} (confidence: ${{r.confidence_score}})`
        ).join("\n");
      }}
    }}),

    new Action({{
      name: "get_composite_signal",
      description: "Get composite trading signal for a specific coin",
      handler: async ({{ coin }}) => {{
        const resp = await fetch(
          `${{BASE}}/v1/signals/composite?api_key=${{API_KEY}}`
        );
        const data = await resp.json();
        const sig = data.signals.find((s: any) => s.coin === coin);
        return sig
          ? `${{coin}}: ${{sig.regime}} (score: ${{sig.composite_score}})`
          : `No signal for ${{coin}}`;
      }}
    }}),

    new Action({{
      name: "execute_trade",
      description: "Execute a trade based on regime analysis",
      handler: async ({{ coin, direction, reason }}) => {{
        // Connect to your exchange API here
        return `[SIMULATED] ${{direction}} ${{coin}}: ${{reason}}`;
      }}
    }})
  ]
}});

Setup Instructions

  1. Get an API key from the API page
  2. Replace YOUR_API_KEY in the code above
  3. Install dependencies: pip install requests (Python) or npm install node-fetch (TypeScript)
  4. Run the script and monitor the output
  5. Connect your exchange API for live trading

API Endpoints Used

Framework
ElizaOS + TypeScript
Data Source
Algo Tick API
# All endpoints used by this template:
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v3/signals/regime
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v1/signals/composite
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v3/signals/safety
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v1/signals/volatility?coin=BTC

Don't just stare at the dashboard. Automate it.

Every metric on this page is available via our sub-millisecond API.
Build trading bots, backtest strategies, and power AI agents with institutional-grade data.

Get API Key →

More Eliza Os Templates

Other Frameworks