# Multi-Coin MACD + RSI Momentum Scanner Agent (MCP Script)

> Use a single `execute_code` loop calling `eterna.getMacd()`, `eterna.getRsi()`, and `eterna.getTickers()` across your entire watchlist, filter in TypeScript for positive MACD histogram acceleration with RSI between 50 and 68, and return only the top 3 ranked setups to the LLM to save 90%+ in context tokens.

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

In standard tool-calling MCP setups, scanning 15 coins across 3 indicators requires 45 sequential tool calls and thousands of wasted tokens. Eterna's Deno sandbox crunches the entire matrix in one pass and hands the LLM a clean 3-row shortlist.

## Key Facts

| Metric | Value | Notes |
|--------|-------|-------|
| Token Reduction | ~90% fewer tokens | Filter inside Deno before returning |
| Indicators | MACD + RSI + 24h Vol | Confluence scoring in TypeScript |
| Universe | 800+ USDT perps | Scan any liquid subset |
| Scheduling | n8n / CLI / Claude | Works interactive or automated |

## 1. Single-Pass Multi-Coin Confluence Scanner

### macd-rsi-momentum-scanner.ts

```typescript
const universe = [
  "BTCUSDT", "ETHUSDT", "SOLUSDT", "XRPUSDT", "BNBUSDT",
  "SUIUSDT", "LINKUSDT", "AVAXUSDT", "TAOUSDT", "AAVEUSDT",
];

const scored = await Promise.all(
  universe.map(async (symbol) => {
    const [ticker, macd, rsi] = await Promise.all([
      eterna.getTickers({ symbol }),
      eterna.getMacd({ symbol, interval: "60" }),
      eterna.getRsi({ symbol, interval: "60", period: 14 }),
    ]);

    const histogram = Number(macd.histogram ?? 0);
    const rsiVal = Number(rsi.value ?? rsi.latest ?? 50);
    const change24h = Number(ticker[0].price24hPcnt ?? 0) * 100;
    const bullish = histogram > 0 && rsiVal >= 52 && rsiVal <= 68;
    const bearish = histogram < 0 && rsiVal >= 32 && rsiVal <= 48;

    return {
      symbol,
      price: Number(ticker[0].lastPrice),
      change24hPct: Number(change24h.toFixed(2)),
      histogram: Number(histogram.toFixed(5)),
      rsi: Number(rsiVal.toFixed(1)),
      signal: bullish ? "MOMENTUM_LONG" : bearish ? "MOMENTUM_SHORT" : "NEUTRAL",
    };
  }),
);

return scored.filter((r) => r.signal !== "NEUTRAL");
```

**Returns:** Only non-neutral MACD + RSI momentum signals, keeping LLM context compact.

## Frequently Asked Questions

### Why require RSI between 52 and 68 instead of above 70 for momentum longs?

Entering when RSI is already above 75 often buys the exhaustion wick. Filtering for 52 to 68 captures fresh momentum after the MACD turn while leaving room for continuation.

## References & Primary Sources

- [execute_code vs Multi-Tool Calling](https://ai.eterna.exchange/guides/execute-code-vs-tool-calling): Benchmarks on why filtering in Deno beats multi-tool JSON bloat.

## Related Guides

- [MCP execute_code vs Tool Calling: Why Code-Execution MCP Uses ~90% Fewer Tokens](https://ai.eterna.exchange/guides/execute-code-vs-tool-calling)
- [n8n AI Agent Workflow for Crypto Trading via Eterna MCP](https://ai.eterna.exchange/integrations/n8n-make-automation)
- [EMA 20/50 Trend-Following AI Crypto Trading Agent (MCP Script)](https://ai.eterna.exchange/strategies/ema-crossover-trend-agent)
- [Eterna MCP SDK Reference: All 30+ eterna.* Methods](https://ai.eterna.exchange/sdk)
