| name | crypto-contract-trading |
| description | Comprehensive cryptocurrency contract trading analysis: technical indicators, multi-strategy backtesting with real market data, event-driven analysis, risk management, and position sizing for BTC/ETH contracts on Binance/OKX/Gate.io. Trigger: crypto analysis, backtest, long or short, ETH/BTC analysis, technical indicators, position sizing, stop loss, trading strategy, or Chinese equivalents like contract trading, technical analysis, backtesting, long/short, position management. |
| version | 1.0.0 |
Crypto Contract Trading Analysis
Comprehensive skill for cryptocurrency futures/perpetual contract trading analysis, combining technical analysis, event-driven frameworks, and risk management from classic investment literature.
Data Acquisition
Priority Data Sources (tested from China mainland)
-
Gate.io API (primary, reliable):
- Daily:
https://www.gateio.ws/api/v4/spot/candlesticks?currency_pair={SYMBOL}_USDT&interval=1d&limit=120
- 4h: change
interval=4h&limit=200
- Format:
[timestamp, vol_quote, close, high, low, open, vol_base, is_closed]
- WARNING: Non-standard field order (close=index 2, open=index 5)
-
Alternative.me (sentiment): https://api.alternative.me/fng/?limit=30
-
Binance/CoinGecko/CryptoCompare: Often BLOCKED from China. Try first, fall back to Gate.io.
Data Processing
Save raw JSON. Verify: candle count, date range, first/last price, 7d/14d/30d changes.
Technical Indicators (compute ALL)
Trend: SMA(5,10,20,60), EMA(12,26), MACD(12,26,9), Bollinger(20,2), ADX(14)
Momentum: RSI(6,14), KDJ(9,3,3)
Volume: 5d/20d ratio, Open Interest, Funding Rate
Volatility: ATR(14), daily/annualized vol
MA arrangement check: perfect bearish (MA5<MA10<MA20<MA60) or bullish.
Signal Scoring (-2 to +2 per dimension, total -10 to +10)
- MA System: price vs all MAs, alignment
- RSI: <40 bearish, >55 bullish, <30 contrarian bullish
- MACD: cross direction + histogram expanding/contracting
- Bollinger: above/below midline, extreme bands
- Trend: 7d + 30d change direction
- Sentiment: Extreme Fear <15 = contrarian bullish (+1)
Score <= -4: SHORT | -1 to -3: Cautious SHORT | >= +4: LONG | +1 to +3: Cautious LONG | 0: Wait
Multi-Strategy Backtesting
Always test ALL six strategies:
- MA Cross (5/20): Golden/death cross signals
- RSI Mean Reversion: RSI<30 long, >70 short, exit at 55/45
- MACD+BB Combo: MACD cross + price near BB band
- Trend Follow (MA20+RSI): Price vs MA20 + RSI vs 50
- BB Mean Reversion: Touch bands, exit at middle
- Buy & Hold: Baseline
Parameters: $10K initial, 0.1% taker fee. Report: return, trades, win rate, max DD, profit factor.
Key Insight
Win rate alone is misleading. A 25% win rate with 3:1 R:R is profitable. Always report profit factor and max drawdown.
Event-Driven Analysis
Event Types & Response
- Regulatory (SEC, bans): Extreme impact. Pre-position, follow momentum.
- Macro (Fed, CPI): High. Rate cuts favor risk assets.
- Project (upgrades, partnerships): Medium. Buy rumor, sell news.
- Market Structure (unlocks, whale moves): High. Monitor on-chain.
- Black Swan (exchange collapse): Extreme. Only defend via position sizing.
Sentiment Signals
- Fear & Greed <15 = contrarian bullish; >80 = contrarian bearish
- Long/Short Ratio <0.8 crowded short; >1.5 crowded long
- Funding Rate extreme = potential reversal
- "Crypto is dead" narrative = potential bottom
On-Chain (crypto-specific)
- MVRV Z-Score red zone = overvalued
- Exchange net flow: inflows = selling pressure, outflows = accumulation
- Whale transfers to exchanges = potential dump
Risk Management
Per-Trade Rules
| Parameter | Conservative | Standard | Aggressive |
|---|
| Single trade risk | 0.5-1% | 1-2% | 2-5% |
| Total position limit | 20% | 40% | 60% |
| Leverage | 2-5x | 5-10x | 10-20x |
| Daily max loss | 2% | 5% | 10% |
Stop-Loss Methods
- Fixed %: Simple but ignores volatility
- ATR-based (recommended): 1.5-3x ATR, adapts to market conditions
- Technical level: Beyond key support/resistance
- Trailing stop: Move 1 ATR forward per 1 ATR profit
Position Sizing
Position Size = (Capital x Risk%) / (Entry - StopLoss)
Kelly: f* = (p x b - q) / b — use Half-Kelly in practice
Drawdown Control
- Daily loss >= 5%: STOP trading
- Weekly loss >= 10%: Reduce to 50%
- Monthly loss >= 20%: Clear all, review strategy
- Peak drawdown >= 30%: Half position until 90% recovery
Market Environment Strategy Selection
| Environment | Identify | Strategy | Position |
|---|
| Strong uptrend | ADX>25, bullish MAs | Trend follow, buy dips | 80-100% |
| Strong downtrend | ADX>25, bearish MAs | Trend follow short | 60-80% |
| Wide oscillation | ADX<20, expanding BB | BB mean reversion | 40-60% |
| Narrow oscillation | ADX<15, contracting BB | Wait for breakout | Clear |
| Extreme volatility | >10% daily vol | Strict stops, low leverage | 20-30% |
Pre-Trade Checklist
- Macro clear? (no major news in 4h)
- Trend confirmed daily + weekly?
- 2+ independent indicators agree?
- Risk/reward >= 1:2?
- Stop-loss set?
- Position within risk rules?
- Today loss < daily limit?
- Emotionally stable?
Contract-Specific Risks
- Liquidation: Never exceed 10x, always set stop-loss
- Wick/Flash crash: Avoid trading during major news, use limit orders
- Exchange risk: Distribute across platforms
- Funding rate: Monitor for hidden holding costs
- Liquidity: Only trade majors (BTC/ETH)
Report Output Format
- Price Overview (current, changes, 120d range)
- Technical Indicators (all with signals)
- Signal Scoring Matrix (total score + verdict)
- Backtest Results Table (all strategies compared)
- Best Strategy Trade Log (trade-by-trade)
- Risk Metrics (vol, VaR, position sizing)
- Recommendation (entry, stop, targets, R:R)
- Conflicting Signals (bull vs bear side by side)
Classic Reading List
| Book | Author | Core Value |
|---|
| Japanese Candlestick Charting | Steve Nison | K-line patterns |
| Technical Analysis of Financial Markets | John Murphy | Comprehensive TA |
| Reminiscences of a Stock Operator | Edwin Lefevre | Trading philosophy |
| The Alchemy of Finance | George Soros | Reflexivity theory |
| Trade Your Way to Financial Freedom | Van Tharp | Position sizing |
| Way of the Turtle | Curtis Faith | Systematic trading |
| Trading for a Living | Alexander Elder | Triple screen system |
| Market Wizards | Jack Schwager | Top trader interviews |
| The Black Swan | Nassim Taleb | Extreme risk philosophy |
| Technical Analysis of Stock Trends | Edwards & Magee | Chart patterns |
Pitfalls
- Binance API often blocked from China, use Gate.io fallback
- Python Chinese characters on Windows may garble (GBK encoding), use numeric data
- Generated data acceptable only when all real APIs fail; always disclose source
- Mean reversion fails in persistent trends, never use as sole strategy
- RSI<30 does NOT mean immediate bounce in crypto
- Always include past performance disclaimer
- Backtest win rate alone is meaningless, report profit factor and max drawdown
Verification
- Data source confirmed (print API sample)
- All indicators computed (no None at current bar)
- Backtest final capital matches trade PnL sequence
- Signal score arithmetic correct
- Stop-loss/target within ATR range