# RSI Mean-Reversion AI Crypto Trading Bot (Runnable MCP Script)

> An RSI mean-reversion agent on Eterna MCP screens liquid USDT perpetuals in one `execute_code` call using `eterna.getRsi()` plus a higher-timeframe `eterna.getEma()` trend filter (so it only buys oversold dips above the 200 EMA and avoids catching falling knives), then places a risk-sized limit order with automatic `stopLoss` and `takeProfit`.

- Canonical URL: https://ai.eterna.exchange/strategies/rsi-mean-reversion-agent
- Last updated: November 23, 2026
- Author: Eterna Quant & AI Team (Systematic Execution & MCP Playbooks)
- MCP endpoint: https://mcp.eterna.exchange/mcp

Naive RSI < 30 bots blow up during strong downtrends. Combining Eterna's native `getRsi()` and `getEma()` inside a single sandbox execution lets your AI agent filter regime cleanly and execute at 0.014% maker fees.

## Key Facts

| Metric | Value | Notes |
|--------|-------|-------|
| SDK Indicators | getRsi + getEma | Zero manual candle math |
| Target Entry | Limit (0.014%) | Maker fee beats market-order drag |
| Timeframe | 15m / 1h | 4h EMA-200 regime filter |
| Risk Rule | 1% equity / trade | Hard stopLoss + 2R takeProfit |

## 1. Runnable `execute_code` RSI + EMA Filter Script

Paste this prompt or code into Claude, Cursor, or Eterna CLI to scan top majors in one turn.

### rsi-mean-reversion-scan.ts

```typescript
const watchlist = ["BTCUSDT", "ETHUSDT", "SOLUSDT", "XRPUSDT", "SUIUSDT"];
const candidates = [];

for (const symbol of watchlist) {
  const [ticker, rsi15m, ema200_1h] = await Promise.all([
    eterna.getTickers({ symbol }),
    eterna.getRsi({ symbol, interval: "15", period: 14 }),
    eterna.getEma({ symbol, interval: "60", period: 200 }),
  ]);

  const price = Number(ticker[0].lastPrice);
  const rsi = Number(rsi15m.value ?? rsi15m.latest);
  const ema200 = Number(ema200_1h.value ?? ema200_1h.latest);

  if (price > ema200 && rsi <= 32) {
    candidates.push({ symbol, setup: "OVERSOLD_UPTREND_LONG", price, rsi, ema200 });
  } else if (price < ema200 && rsi >= 68) {
    candidates.push({ symbol, setup: "OVERBOUGHT_DOWNTREND_SHORT", price, rsi, ema200 });
  }
}

return { scanned: watchlist.length, matches: candidates };
```

**Returns:** Filtered list of regime-aligned RSI mean-reversion candidates ready for risk sizing.

## 2. Common Failure Modes & How to Avoid Them

- Never buy RSI < 30 during macro liquidation cascades without checking 1h/4h EMA trend direction.
- Use limit orders near the bid/ask (`0.014%` maker fee) rather than chasing fills with market orders.
- Cap exposure to one position per correlated cluster (e.g., do not long BTC, ETH, and SOL simultaneously on the same dip).

## Frequently Asked Questions

### What RSI threshold works best on crypto perpetuals?

Liquid majors like BTCUSDT and ETHUSDT often bounce around 28 to 33 in uptrends; higher-beta alts frequently stretch to 20 to 25. Always pair RSI with a trend filter and fixed stopLoss.

## References & Primary Sources

- [Automated Technical Analysis on Eterna MCP](https://ai.eterna.exchange/guides/automated-technical-analysis-mcp): Full guide to all 6 built-in Eterna indicator methods.

## Related Guides

- [EMA 20/50 Trend-Following AI Crypto Trading Agent (MCP Script)](https://ai.eterna.exchange/strategies/ema-crossover-trend-agent)
- [Bollinger Band Squeeze & Breakout AI Agent (MCP Script)](https://ai.eterna.exchange/strategies/bollinger-band-breakout-agent)
- [AI Crypto Trading Risk Management: Position Sizing, TP/SL & Kill Switches](https://ai.eterna.exchange/guides/ai-trading-risk-management-guardrails)
- [AI Trading for Bitcoin (BTCUSDT) via Eterna MCP](https://ai.eterna.exchange/markets/btc)
