ワンクリックで
bitmex-recipe-testnet-strategy-backtest
Validate a strategy across multiple testnet sessions before going live.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Validate a strategy across multiple testnet sessions before going live.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Price, funding, liquidation, and balance alerts using polling and WebSocket on bitmex-cli.
Autonomy progression for bitmex-cli agents: from read-only market data to autonomous fund management.
Delta-neutral basis trading between BitMEX perpetuals and fixed-date futures: entry, monitoring, and exit.
Dollar cost averaging on bitmex-cli: testnet-first, fixed qty per interval, limit orders, and position cap enforcement.
Error category handling, duplicate order prevention, retry logic, and partial fill management for bitmex-cli.
Minimize trading fees on bitmex-cli: maker vs taker, post-only orders, commission tiers, and fee audit.
| name | bitmex-recipe-testnet-strategy-backtest |
| description | Validate a strategy across multiple testnet sessions before going live. |
Run your strategy on the BitMEX testnet for multiple independent sessions, track performance statistics, and only promote to live after passing consistency criteria.
jq and bc installed.testnet.bitmex.com.BITMEX_API_KEY and BITMEX_API_SECRET to your testnet credentials.Execute your strategy with the --testnet flag throughout:
# Example: place entry order
bitmex --testnet order buy XBTUSD 100 --order-type Limit \
--price <entry_price> --yes -o json | jq '{orderID, price, ordStatus}'
# Monitor fills
bitmex --testnet ws --auth execution -o json | jq -c '.data[]? | {side, price, orderQty, ordStatus}'
After each session, extract the trade history:
SESSION_DATE=$(date -u +%Y%m%dT%H%M%SZ)
bitmex --testnet execution trade-history --count 100 -o json \
> /tmp/session_${SESSION_DATE}.json
jq '{
trades: length,
realisedPnl: ([.[].realisedPnl] | add // 0),
totalFees: ([.[].commission] | add // 0),
symbols: ([.[].symbol] | unique)
}' /tmp/session_${SESSION_DATE}.json
jq '
. as $trades |
($trades | length) as $n |
([.[] | select(.realisedPnl > 0)] | length) as $wins |
{
totalTrades: $n,
winRate: (if $n > 0 then ($wins / $n * 100) else 0 end),
avgPnl: ([.[].realisedPnl] | add // 0 | . / (if $n > 0 then $n else 1 end)),
maxLoss: ([.[].realisedPnl] | min // 0)
}
' /tmp/session_${SESSION_DATE}.json
cat /tmp/session_*.json | jq -s '
flatten |
{
totalTrades: length,
totalPnl: ([.[].realisedPnl] | add // 0),
totalFees: ([.[].commission] | add // 0),
winCount: ([.[] | select(.realisedPnl > 0)] | length)
} |
. + {winRate: (.winCount / .totalTrades * 100),
netPnl: (.totalPnl - .totalFees)}
'
Promote to live only if all criteria pass:
Remove --testnet flag and use your live API credentials. Start at 10% of testnet position sizes for the first week.