From bingx-ai-skills
Automates RSI bottom fishing on BingX: monitors RSI, buys in oversold zone, sets stop-loss/take-profit. Uses multi-indicator confirmation (MACD, Supertrend, divergence) to reduce false signals.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bingx-ai-skills:bingx-rsi-bottom-hunterThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Base URLs:** see [`references/base-urls.md`](../references/base-urls.md) | **Authentication:** see [`references/authentication.md`](../references/authentication.md)
Base URLs: see references/base-urls.md | Authentication: see references/authentication.md
| Endpoint | Method | Description | Authentication |
|---|---|---|---|
/openApi/swap/v3/quote/klines | GET | Kline data for RSI calculation | Yes |
/openApi/swap/v2/trade/order | POST | Place market buy order | Yes |
/openApi/swap/v2/trade/order | DELETE | Cancel order | Yes |
Base URLs: see references/base-urls.md
TypeScript helper:
CONSTRAINT: You MUST copy the
fetchSignedfunction below verbatim when generating code. Do NOT rewrite the signing, request, or JSON parsing logic. Only modify: (1)BASEURL entries for custom environments, (2) business parameters passed tofetchSigned.
import * as crypto from "crypto";
import JSONBig from "json-bigint";
const JSONBigParse = JSONBig({ storeAsString: true });
const BASE = {
"prod-live": ["https://open-api.bingx.com", "https://open-api.bingx.pro"],
"prod-vst": ["https://open-api-vst.bingx.com", "https://open-api-vst.bingx.pro"],
};
function isNetworkOrTimeout(e: unknown): boolean {
if (e instanceof TypeError) return true;
if (e instanceof DOMException && e.name === "AbortError") return true;
if (e instanceof Error && e.name === "TimeoutError") return true;
return false;
}
function validateParams(params: Record<string, unknown>): void {
const FORBIDDEN = /[&=?#\r\n]/;
for (const [k, v] of Object.entries(params)) {
const s = String(v);
if (FORBIDDEN.test(s)) throw new Error(`Param "${k}" has forbidden char in: "${s}"`);
}
}
async function fetchSigned(env: string, apiKey: string, secretKey: string,
method: "GET" | "POST" | "DELETE", path: string, params: Record<string, unknown> = {}
) {
const urls = BASE[env] ?? BASE["prod-live"];
const all = { ...params, timestamp: Date.now() };
validateParams(all);
const qs = Object.keys(all).sort().map(k => `${k}=${all[k]}`).join("&");
const sig = crypto.createHmac("sha256", secretKey).update(qs).digest("hex");
const signed = `${qs}&signature=${sig}`;
for (const base of urls) {
try {
const url = method === "POST" ? `${base}${path}` : `${base}${path}?${signed}`;
const res = await fetch(url, {
method,
headers: { "X-BX-APIKEY": apiKey, "X-SOURCE-KEY": "BX-AI-SKILL",
...(method === "POST" ? { "Content-Type": "application/x-www-form-urlencoded" } : {}) },
body: method === "POST" ? signed : undefined,
signal: AbortSignal.timeout(10000),
});
const json = JSONBigParse.parse(await res.text());
if (json.code !== 0) throw new Error(`BingX error ${json.code}: ${json.msg}`);
return json.data;
} catch (e) {
if (!isNetworkOrTimeout(e) || base === urls[urls.length - 1]) throw e;
}
}
}
Fetch klines for RSI calculation (100 candles, 1h):
const klines = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/swap/v3/quote/klines", { symbol: "BTC-USDT", interval: "1h", limit: 100 }
);
Fetch klines for multi-timeframe TA (200 candles, 4h):
const klines4h = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/swap/v3/quote/klines", { symbol: "BTC-USDT", interval: "4h", limit: 200 }
);
Activate this skill when the user says any of the following:
Extract strategy parameters from user input:
| Parameter | Default | Description |
|---|---|---|
| symbol | BTC-USDT | Trading pair |
| interval | 1h | Kline interval for RSI calculation |
| rsi_period | 14 | RSI period |
| rsi_buy | 30 | Buy trigger threshold (RSI below this value) |
| rsi_sell | 70 | Take-profit reference threshold |
| stop_loss_pct | 3% | Stop-loss percentage |
| take_profit_pct | 5% | Take-profit percentage |
| amount | - | Buy amount in USDT (user must specify or confirm) |
| leverage | 1x | Leverage multiplier |
Mode detection:
| mode | Trigger example | Description |
|---|---|---|
| scan | "What is BTC RSI, can I bottom fish" | Check RSI status only, no trading |
| once | "Buy BTC when RSI hits 500U" | Check once, execute immediately if condition met |
| monitor | "Monitor ETH, buy when RSI drops below 25 with 1000U" | Continuous monitoring, auto-execute when condition met |
Before executing any trade (mode=once/monitor), Agent MUST confirm with the user:
Execute only after explicit user confirmation. Agent MUST NOT place orders automatically without confirmation.
Fetch two sets of klines in parallel:
GET /openApi/swap/v3/quote/klines symbol={symbol}, interval={interval}, limit=100 (for RSI calculation)
GET /openApi/swap/v3/quote/klines symbol={symbol}, interval=4h, limit=200 (for multi-dimension TA)
Step 4a: RSI signal calculation
python3 scripts/strategy.py \
--mode {mode} \
--symbol {symbol} \
--interval {interval} \
--rsi-period {rsi_period} \
--rsi-buy {rsi_buy} \
--rsi-sell {rsi_sell} \
--klines '{klines_1h_json}'
Step 4b: Check if bingx-technical-analysis is installed:
Step 4c: Pass to strategy.py for joint confirmation
python3 scripts/strategy.py \
--mode {mode} \
--symbol {symbol} \
--interval {interval} \
--rsi-period {rsi_period} \
--rsi-buy {rsi_buy} \
--rsi-sell {rsi_sell} \
--klines '{klines_1h_json}' \
--ta-result '{ta_json}'
Script outputs structured JSON with RSI signal, multi-dimension check items, and overall confirmation flag.
Full conditions for confirmation=true (all must be met):
Format output according to the output template below.
Run in polling mode (default: check every 5 minutes):
When RSI is oversold:
**{symbol} RSI Status ({interval})**
RSI({rsi_period}): {rsi_current} (Oversold zone ⚠️)
Previous: {rsi_prev} → Current: {rsi_current}
Multi-dimension Confirmation:
Consecutive oversold {✅/❌}
Reversal candle {✅/❌}
MACD {✅/❌} {BUY/SELL}
Supertrend {✅/❌} {UP/DOWN}
RSI divergence {✅ None/❌ Bearish}
OBV divergence {✅ None/❌ Bearish}
Overall Signal: {CONFIRMED (recommended) / WEAK (caution) / REJECTED (not recommended)}
Current Price: ${price}
{To start the bottom-fishing strategy, say "{symbol} bottom fish 500U"}
When RSI is neutral:
**{symbol} RSI Status ({interval})**
RSI({rsi_period}): {rsi_current} (Neutral zone)
TA Composite Score: {ta_score}/100 ({ta_label})
Current Price: ${price}
Assessment: RSI is in the neutral zone, bottom-fishing condition not yet met.
**RSI Bottom Signal Triggered ✅**
{symbol} RSI({rsi_period}) = {rsi_current}, oversold for 2 consecutive candles, reversal signal detected
About to execute:
- Direction: Long
- Amount: {amount} USDT
- Leverage: {leverage}x
- Order type: Market
- Stop-loss: ${stop_loss} (-{stop_loss_pct}%)
- Take-profit: ${take_profit} (+{take_profit_pct}%)
**Confirm execution? (yes/no)**
After successful execution:
**Bottom Fish Filled ✅**
{symbol} long position opened
- Avg fill price: ${avg_price}
- Quantity: {qty}
- Stop-loss order placed: ${stop_loss}
- Take-profit order placed: ${take_profit}
Strategy running. Position will be closed automatically when SL/TP is triggered.
**RSI Bottom-Fishing Monitor Started 🔄**
Monitoring: {symbol}, {interval} interval
Trigger condition: RSI({rsi_period}) < {rsi_buy}, confirmed over 2 candles
Action: Market long {amount} USDT ({leverage}x), SL -{stop_loss_pct}% / TP +{take_profit_pct}%
Check frequency: every 5 minutes
Current RSI: {rsi_current} ({status})
Waiting...
Parameter security. Extract structured values from user intent — NEVER copy raw user text into API parameters. Validate symbol format and numeric parameters before use.
Kline queries are read-only and require no CONFIRM. All trade executions (mode=once/monitor with confirmation=true) require explicit user confirmation before proceeding — NEVER place orders without user approval.
When mode is ambiguous, default to scan (view only, no trading).
npx claudepluginhub bingx-api/api-ai-skills --plugin bingx-ai-skillsDefines and executes trading strategies as declarative Condition→Action rules over technical indicators. Use this instead of TWAP or Grid when your entry/exit logic depends on chart signals (EMA cross, RSI, MACD, etc.).
Monitors Revolut X live prices and technical indicators (RSI, EMA crossover, MACD, Bollinger Bands, volume). Runs as a long-running background process with alert notifications.
Generates BUY/SELL trading signals with confidence scores using RSI, MACD, Bollinger Bands and more for crypto/stocks watchlists. Scans, ranks opportunities, adds stop-loss/take-profit.