بنقرة واحدة
bitmex-recipe-daily-pnl-report
Daily realised P&L summary from trades and wallet history.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Daily realised P&L summary from trades and wallet history.
التثبيت باستخدام 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-daily-pnl-report |
| description | Daily realised P&L summary from trades and wallet history. |
Aggregate today's realised P&L, fees paid, and unrealised exposure from trade history and wallet snapshots.
BITMEX_API_KEY and BITMEX_API_SECRET set.jq installed.TODAY to the current UTC date.TODAY=$(date -u +%Y-%m-%d)
bitmex execution trade-history --reverse --count 500 -o json \
| jq --arg d "$TODAY" '[.[] | select(.timestamp | startswith($d))]' \
> /tmp/trades_today.json
P&L units depend on the instrument's settlement currency. XBt-settled instruments (e.g. XBTUSD) report in satoshis; divide by 1e8 for XBT. USDT-settled instruments (e.g. XBTUSDT) report in USDT units. Always group by
homeNotionalcurrency rather than summing across all symbols.
jq 'group_by(.currency) | map({
currency: .[0].currency,
realisedPnl: ([.[].realisedPnl] | add // 0)
})' /tmp/trades_today.json
jq '[.[].commission] | add // 0' /tmp/trades_today.json
jq 'group_by(.symbol) | map({
symbol: .[0].symbol,
trades: length,
realisedPnl: ([.[].realisedPnl] | add // 0),
feesTotal: ([.[].commission] | add // 0)
})' /tmp/trades_today.json
Pull opening and closing wallet snapshots from history:
bitmex wallet history --currency XBt --count 100 -o json \
| jq --arg d "$TODAY" '[.[] | select(.timestamp | startswith($d))]
| if length == 0 then {first: null, last: null, delta: 0}
else {first: .[-1].walletBalance, last: .[0].walletBalance,
delta: ((.[0].walletBalance // 0) - (.[-1].walletBalance // 0))}
end'
bitmex position list -o json \
| jq '{totalUnrealisedPnl: ([.[].unrealisedPnl] | add // 0),
positions: [.[] | select(.currentQty != 0) | {symbol, currentQty, unrealisedPnl}]}'