6DuckLearn Skills

dragon regret

Use when analyzing, tuning, backtesting, or extending the Dragon's Regret mean-reversion strategy, especially for ATR/z-score normalized entry logic, higher-timeframe trend filtering, execution-cost modeling, parameter scans, and walk-forward validation.

finance Tags: okx, trading, community, okx-marketplace, finance

6DuckLearn provenance: Community skill by 0xying, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/dragon-regret). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.

Financial safety boundary: Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

亢龙有悔 (Dragon's Regret)

This publishable skill package includes these core files:

  • spring_reversion_strategy.py
  • tests/test_spring_reversion_strategy.py

Use this skill when working on the included Dragon's Regret strategy or when porting the same workflow to another workspace.

What This Strategy Does

  • Trades short-term mean reversion, typically on BTC/USDT 15m
  • Uses normalized exhaustion signals instead of a fixed candle percent trigger
  • Requires body_atr_ratio, return_zscore, RSI, volume spike, and momentum deceleration
  • Uses a higher-timeframe regime filter to avoid fading strong trends
  • Models maker/taker fees and slippage in both realized PnL and equity curve
  • Supports run_backtest(), run_parameter_scan(), and run_walk_forward()

Default Workflow

  1. Read spring_reversion_strategy.py first to confirm config keys, signal flow, execution-cost assumptions, and state transitions.
  2. If the task changes behavior, update tests/test_spring_reversion_strategy.py in the same package.
  3. Validate with:
python3 -m unittest -q tests/test_spring_reversion_strategy.py
  1. Only move from backtest to live data or trading after checking risk rules and tool availability.

OKX Integration

Prefer MCP tools when they are available in the current Codex session.

Market Data

  • If a tool named okx-cex-market is available, use it for read-only tasks first:
    • latest ticker
    • order book
    • recent candles / OHLCV
    • funding or mark-price context if supported
  • Convert live market data into the same schema expected by spring_reversion_strategy.py before running signal checks or backtests.

Trading

  • If a tool named okx-cex-trade is available, use it only after:
    • the strategy has been backtested
    • the user explicitly asks for live or paper execution
    • current credentials and account mode are confirmed
  • Default to paper / simulated execution when the tool supports it.
  • Never place live orders silently.

CLI Fallback

If MCP tools are unavailable but OpenClaw CLI is installed, inspect available integrations first and do not invent flags. In OpenClaw environments, relevant plugin surfaces may appear as OpenClaw Trading and OKX Trade MCP.

openclaw plugins list
openclaw docs okx
openclaw docs trading

If neither MCP tools nor a documented CLI integration is available, stop at analysis/backtest mode and report the missing OKX execution surface.

Credentials

Authenticated OKX workflows may require environment variables such as:

  • OKX_API_KEY
  • OKX_SECRET_KEY
  • OKX_PASSPHRASE

Do not print secret values, do not hardcode them, and do not proceed with authenticated trading if they are missing.

Implementation Guardrails

  • Do not reintroduce a fixed 5% candle trigger. Entry logic should stay normalized around body_atr_ratio and return_zscore.
  • Keep realized PnL, unrealized PnL, and equity curve on the same execution-cost model.
  • Do not bypass the higher-timeframe trend filter unless explicitly requested.
  • Keep strategy-core functions deterministic. Avoid network calls or exchange-specific live execution logic inside the backtest core.
  • Preserve isolated state resets so parameter scans and walk-forward runs do not leak positions, balances, or trade logs across runs.

Change Map

  • Signal logic: indicator calculation and entry checks
  • Position sizing and execution costs: sizing, slippage, maker/taker fees, open/close accounting
  • Exit logic: ATR stop, trailing logic, and time stop
  • Analytics: backtest, parameter scan, walk-forward, export helpers

Trading Risk Notice

  • This strategy can lose money in persistent trends, thin liquidity, fast gaps, and execution-quality degradation.
  • Backtest results do not guarantee live performance.
  • Live trading should be treated as high risk even when walk-forward results look acceptable.
  • If execution is requested, enforce small size, clear stop logic, and explicit user confirmation before order placement.

Expected Outputs

When asked for analysis, report:

  • current signal definition
  • trend filter behavior
  • execution-cost assumptions
  • backtest or walk-forward validity
  • missing risks, fragile assumptions, or accounting inconsistencies

When asked for code changes, aim for:

  • atomic diffs
  • matching test updates
  • deterministic outputs
  • no silent changes to accounting or performance metric definitions

Related skills

  • alpha vantage — Cross-asset analysis is its unique advantage—it can simultaneously pull macro data such as the S&P 500, gold, the dollar index, Federal Reserve interest rates, CPI, GDP, etc., allowing one to see at a glance whether "BTC is moving with risk assets today or pricing independently." In conjunction with the OKX Trade Kit, Alpha Vantage is responsible for in-depth historical and macroeconomic context, while OKX provides real-time prices, funding rates, and order book data, with both complementing each other to form a complete analysis chain.
  • apex crypto intelligence — AI-driven multi-exchange cryptocurrency market analysis, arbitrage detection, and hedge fund-level trading reports using real-time data from major exchanges.
  • btc altcoin market pulse — Fetches live OKX market data across Bitcoin and major altcoins, analyzes price momentum, funding rates, open interest, and BTC dominance signals to produce a structured BTC + Altcoin Market Pulse report.
  • cmc okx — CoinMarketCap × OKX dual engine, a one-stop solution for all your cryptocurrency market data needs. CMC provides market cap, supply, dominance, holding distribution, project background, and macro event calendar; the OKX Trade Kit complements with real-time prices, funding rates, open interest, 70+ technical indicators, and order book depth, with both automatically linked and mutually supportive. It supports natural language triggers, whether you ask "What’s the price of Bitcoin?", "How to read the ETH daily chart?" or "Which coin is surging?", Skill automatically recognizes intent, selects tool combinations, outputs structured tables, and includes a "Quick Take" one-sentence summary.
  • congress trades — Track U.S. Congress members' stock trades in real-time, making "smart political money" impossible to hide. Sync member trade disclosure data to a local SQLite database via the Quiver Quant API, allowing flexible queries by politician name, stock code, party, date range, and trade type. Large trades exceeding the configurable amount threshold (default $15,001) automatically trigger alerts, generating structured Alert files for real-time monitoring.
  • crypto research — A systematic cryptocurrency due diligence report, covering everything from price to holding distribution, from technical aspects to a red flag checklist, all in one go. Integrating the OKX Trade Kit (real-time prices, 70+ technical indicators, funding rates, open interest, order book depth) with CoinMarketCap (market cap, token economics, whale distribution, news sentiment), a seven-step research process is executed in parallel, covering market snapshots, technical analysis, derivatives data, project fundamentals, and recent news. The analysis framework specifically distinguishes between legitimate projects and Meme coins, evaluating key signals such as whale concentration, holder trends, 200-day moving average positions, and funding rate extremes, ultimately outputting a green flag/red flag checklist and low/medium/high/very high risk ratings.