Type/to search

Binance Public Lead-Trader Copy Strategy

Common strategy
Created: 2026-11-18 12:18:54
Last modified: in 5 hours
2
Follow
549
Followers

Binance Public Lead-Trader Copy · Strict New-Position Audit + Target-Price Limit Copying

Risk warning: this strategy runs in paper mode by default; enabling 实盘下单 (pLive) places real orders through a dedicated Binance USDⓈ-M sub-account with real P&L and real fees. It subscribes only to Binance's public lead-portfolio data (fill history and closed-position history) — never private endpoints of the lead trader — and does not reproduce the lead trader's results. Limit orders may never fill, filled positions may move against you, and the lead may open and close inside one polling gap. Futures are leveraged; losses can exceed the margin of a single order. No profit is guaranteed — validate with a dedicated sub-account and small size first.

Strategy Concept

The strategy mirrors the core settings of Binance's official copy trading and follows brand-new positions of one Binance futures lead portfolio (default 5075281354358777856) using target-price limit orders instead of chasing with market orders, exiting in proportion to the lead trader's actual reductions.

Four principles govern it:

  • One instance, one binding. Each instance and its dedicated sub-account are bound to exactly one lead portfolio. Persisted state is validated against version + portfolioId + run mode (live/paper); switching lead or mode refuses to start, so positions can never collide.
  • Existing positions are never copied. Only symbols/directions whose flat baseline has been confirmed (an All Closed for that direction after start, with cumulative quantity back to zero, and flat time earlier than the signal) accept new entries. Historical positions from before start, unconfirmed baselines, and top-ups on positions the follower does not hold are all skipped.
  • Follow at the target price, never chase. Entries and adds use the lead's fill average as the limit price, rounded to the tick, posted as GTC. If the book never pulls back to that price the order simply stays until the lead closes the position, at which point it is cancelled automatically. Better fills, but a real chance of missing the whole move.
  • Capital and risk rules aligned with Binance copy trading. Fixed amount (constant margin per order) or fixed ratio (scaled by copy capital vs. the lead's margin balance), per-symbol maximum margin, follow-the-lead or fixed leverage, per-position take-profit/stop-loss (ROE%), total project stop-loss, and a maximum entry slippage setting.

The strategy makes no directional call of its own: everything is driven by the lead's public fills. It trades one-way (positionSide=BOTH) and, in live mode, requires one-way position mode plus single-asset margin mode.

Data Interface and Execution Architecture

Market data, rules and signals come from Binance public HTTP endpoints and the public lead-portfolio API; private endpoints are reached through exchange.IO("api", ...) on the dedicated sub-account, and all critical state is persisted with _G:

  1. Market data and rules. /fapi/v1/exchangeInfo supplies LOT_SIZE / MARKET_LOT_SIZE / PRICE_FILTER / MIN_NOTIONAL for all USDT perpetuals (PERPETUAL and TRADIFI_PERPETUAL), refreshed hourly; /fapi/v1/depth supplies 20 levels for simulated fills and notional sizing; /fapi/v1/premiumIndex supplies mark prices.
  2. Public lead data. lead-portfolio/order-history for fills, position-history for closed rounds (All Closed / Closed), detail / performance / chart-data for the lead's profile and 30D curves. Requests are spaced by at least 900ms; on rate-limit codes (including 90801003, 11012005) the strategy backs off exponentially from 5s to 60s, during which local risk control and exits keep running.
  3. Signal dedupe and ordering. Each fill is keyed by order:symbol:posSide:side:orderTime:type and signed by (updateTime, qty, avgPrice); it is reprocessed only when the signature changes. Closed-position rows are converted into "all closed" events, merged with fills, sorted by time with flat events first.
  4. Baseline state machine. Each symbol:direction tracks known / qty / time / flat / locked. known=false means the baseline is unknown and no new entry is taken. A reduction shrinks the quantity proportionally when the baseline is known; a reduction larger than the tracked quantity invalidates the baseline until a full close is confirmed.
  5. Ordering and reconciliation. Entries are LIMIT + GTC (positionSide=BOTH, client ids prefixed fmzc); exits are MARKET + reduceOnly. At most one in-flight order is stored in pending and booked only on a terminal reply; on restart the strategy recovers the pending order and syncs open limits. In live mode, foreign open orders / conditional orders, or actual positions diverging from the local ledger, raise an error and stop new orders until reconciled manually.
  6. Isolated margin and leverage sync. Before every live entry the strategy reads /fapi/v1/symbolConfig, switches to isolated margin, applies the target leverage, verifies that auto-add-margin is off, and takes that leverage tier's maxNotionalValue as the notional ceiling.

Trading Workflow

text
Configure one Binance futures exchange object + dedicated sub-account (one-way / single-asset) ↓ Validate parameters, equity, absence of foreign orders, and position consistency; bind portfolioId ↓ Each cycle: recover pending order → sync limit orders → read account → update equity curve ↓ Risk scan (per-position TP/SL, total stop) → execute queued reductions ↓ Fetch public fills and closed-position history (900ms throttle, exponential backoff) ↓ Per event: signal freshness → flat-baseline audit → capital and min-size checks ↓ Post GTC limit at the lead's fill price (may stay open; cancelled when the lead closes) ↓ Lead reduces → market exit proportionally; lead All Closed → full exit and lock the round ↓ Book equity, daily stats, symbol stats, operation history → push to the frontend

Signal Recognition and Entry Audit

Every lead entry/add passes a chain of checks; any failure is recorded as "skipped entry" with the reason, both in the UI and the log:

  1. the symbol is watched (* = all USDT perpetuals, or a comma-separated whitelist) and its status is TRADING;
  2. signal latency is within 信号最大有效延迟 (default 45s);
  3. the flat baseline for that symbol:direction is confirmed (an All Closed seen after start);
  4. no add is taken while the first entry is still unfilled; the round is not locked by risk, manual pause or feed halt, and there is no queued exit or opposite position;
  5. account positions and open orders match the local ledger (live mode also requires no foreign or conditional orders);
  6. per-symbol margin cap, available margin, leverage-tier notional cap, minimum quantity and minimum notional all pass.

Target-Price Limit Following

The entry price is the lead's fill average, floored to the tick for buys and ceiled for sells, validated against the exchange minPrice/maxPrice. Quantity is derived from planned margin × leverage, repriced at the least favourable of the limit, best bid and best ask, capped by the notional ceiling, and floored to stepSize, so the margin actually used never exceeds the plan. The order is never repriced afterwards: it sits on the book until the lead closes or reduces that symbol, which triggers the cancellation rules.

All exits are market reduceOnly, sized current position − target remainder, subject to MARKET_LOT_SIZE maxQty / stepSize / minQty; if one order cannot cover the reduction, the next cycle continues.

Risk Control and Halts

  • Per-position TP/SL (ROE%): ROE is (realized this round + unrealized − projected exit fee) / peak margin used. Reaching 仓位止盈比例 closes at market; falling below minus 仓位止损比例 closes at market. The symbol's round is then locked against new entries.
  • Total project stop: when equity falls to initial equity × (1 − 项目总止损比例), the strategy cancels every limit order, queues full liquidation and halts new entries. Clearing it requires frontend confirmation (a forced override is needed while equity is still below the line).
  • Feed continuity halt: if the strategy itself was down for more than 72 hours, fill continuity cannot be proven, so it switches to a feed-halt state instead of risking a mismatched position.
  • Ledger consistency guard: live positions/orders diverging from the local ledger, order replies not matching the persisted intent, or an exit fill exceeding the strategy's own position all stop new orders and raise a status error for manual reconciliation.

Capital Conversion and Fee Accounting

  • Fixed amount (FIXED_AMOUNT): planned margin per entry/add = 定额单笔成本 (default 40U).
  • Fixed ratio (FIXED_RATIO): ratio = copy capital / lead margin balance, planned margin = lead fill notional × ratio / leverage.

Planned margin is then the minimum of the intent, the per-symbol remainder (单合约最大持仓保证金 − used − in-flight limit margin), and available margin headroom (available − 预留可用保证金) / (1 + leverage × one-side fee). Finally it is bounded by the leverage tier's notional ceiling and existing exposure.

Booked fills charge 单边手续费估算 (default 0.05%): entries book the fee as a round loss; exits book (exit price − average entry) × qty × direction − fee as realized P&L. A round settles when the quantity reaches zero, recording win/loss, round ROI (against peak margin), daily and per-symbol statistics, and one LogProfit point.

In paper mode the 20-level real public book is walked for fills; any unfilled remainder becomes a simulated limit order that fills when the book later trades through it. Results therefore reflect real fees and slippage structure, but not true market impact.

Monitoring Frontend and Console

The strategy ships an AppKit page: every visitor sees live status (equity, positions, limit orders, lead profile, operation stream), signed-in users get the full snapshot and analytics, and only the author (owner) can pause/resume entries, change the symbol whitelist, force-close a position, clear halts, refresh lead data and reset statistics. LogStatus renders five tabs: overview & positions, lead vs. follower operations, daily P&L, per-symbol statistics, and logs & notes.

Console commands: pause, resume, and close:SYMBOL:DIRECTION (e.g. close:BTCUSDT:LONG) which cancels limits and closes at market.

Live Configuration

  • Add one Futures_Binance exchange object pointing at a dedicated Binance USDⓈ-M sub-account (isolated from manual trading and other strategies);
  • The account must be in one-way position mode and single-asset margin mode; startup fails otherwise;
  • On first start the account should hold no other positions or open orders, and equity must be positive;
  • Paper mode needs no exchange object and uses 跟单总资金 as initial equity and virtual cash;
  • The state key binance-lead-copy-v3 is bound to the lead portfolio and run mode; to change lead or switch live/paper, create a new strategy instance.

Main Live Parameters

ParameterGroupDefaultPurpose
Live tradingRun & Lead SourceOffOff: simulate against Binance's public book. On: real orders in the dedicated sub-account.
Lead portfolio IDRun & Lead Source5075281354358777856Detail-page link or trailing numeric ID; one lead per instance.
Copy symbol scopeRun & Lead Source**/ALL for all USDT perpetuals, or a comma-separated whitelist (e.g. BTCUSDT,ETHUSDT).
Poll interval (s)Run & Lead Source2Cycle interval; ≥2s recommended to avoid public-API rate limits (min 0.5s).
Max signal age (s)Run & Lead Source45Entry/add signals older than this are skipped; exit signals always execute.
Copy modeCopy & LeverageFixed amountFixed amount (constant cost per order) or fixed ratio (scaled to the lead's margin balance).
Copy capital (USDT)Copy & Leverage300Paper initial equity, ratio numerator, and total-stop reference.
Cost per order (USDT)Copy & Leverage40Planned margin per entry/add in fixed-amount mode.
Max margin per symbol (USDT)Copy & Leverage120Cap on position plus in-flight limit margin for one symbol; 0 = unlimited.
Leverage modeCopy & LeverageFollow leadFollow the lead's recent leverage for that symbol (capped) or use a fixed value.
Default/fixed leverageCopy & Leverage2Used in fixed mode, and as the fallback when the lead's leverage is unknown.
Follow leverage capCopy & Leverage10Maximum leverage in follow mode (1–20).
Take-profit per position (%)TP/SL & Risk0Close at market when the position's ROE reaches this; 0 = exit with the lead.
Stop-loss per position (%)TP/SL & Risk0Close at market when the position's ROE loss reaches this; 0 = disabled.
Total stop-loss (%)TP/SL & Risk25Cancel, liquidate and halt when equity loses this much vs. initial equity; 0 = off.
Max entry slippage (%)TP/SL & Risk0.5Maximum adverse-slippage setting used for validation and display (0.1%–5%).
Free-margin reserve (USDT)TP/SL & Risk0Headroom withheld from available margin when sizing entries; 0 matches Binance copy trading.
One-side fee estimate (%)TP/SL & Risk0.05Taker fee used for simulated fills and all accounting/statistics.

Operating Notes

  1. Copying is not cloning returns. Follow-at-limit entries fill at different times and prices from the lead; in a rally the limit may never fill, leaving the follower flat while the lead profits.
  2. New positions only means missing some moves. To avoid buying into an existing run-up, positions from before start and unconfirmed baselines are skipped; a lead who never goes flat can leave the strategy idle for a long time.
  3. API latency and throttling. Only public endpoints are used, so latency is set by the poll interval and the 900ms throttle; during backoff no new signals are processed (risk control and exits still run), which can miss short-lived round trips.
  4. Use a dedicated account. Manual orders, conditional orders or other strategies on the same sub-account trigger the ledger-consistency guard and pause new orders; a "pending reconciliation" state must be checked on Binance before restarting.
  5. Risk thresholds are margin-return based. Position TP/SL use ROE% (denominator: peak margin used), matching Binance's copy-trading "ROI" notion rather than the underlying's percentage move.
  6. Clearing the total stop needs a human. After a total-stop halt the strategy only stops and cancels; it never re-enters by itself, and a forced clear requires a second confirmation in the frontend while equity is still below the line.
  7. State lives in the archive. Changing the lead, switching live/paper or deleting the archive rebuilds the ledger — never do it while positions are open, or the ledger and the real account can no longer be aligned.
  8. The frontend is a monitor, not a risk engine. It displays what the running robot reports; with no robot running it shows offline rather than fabricated data.
Source
JavaScript
// 币安公开带单跟随策略 · 币安一致跟单设置 + 严格新仓位审核 + 策略前端 (AppKit)
// 核心原则:
// 1. 单实例单绑定:每个策略实例及专用子账户严格绑定单一 pPortfolioId(默认熬鹰资本 5075281354358777856),防仓位冲突
// 2. 已有仓位不跟随:仅跟随启动后确认空仓基线(All Closed)开启的全新仓位,中途已有仓位/历史补仓一律跳过
// 3. 与币安跟单设置一致:支持定额(FIXED_AMOUNT)/定比(FIXED_RATIO)、跟随/固定杠杆、单合约最大持仓保证金、仓位止盈止损(%)、项目总止损(%)、最大滑点
// 4. 支持 Crypto 永续 (PERPETUAL) 与 TradFi 股票永续 (TRADIFI_PERPETUAL),配套 FMZ 策略前端实时推送与监控

var API = 'https://fapi.binance.com';
var FEED = 'https://www.binance.com/bapi/futures/v1/friendly/future/copy-trade/lead-portfolio/';
var PUB_FEED = 'https://www.binance.com/bapi/futures/v1/public/future/copy-trade/lead-portfolio/';
var STATE_KEY = 'binance-lead-copy-v3';
var DAY = 86400000;
Strategy parameters
Strategy parameters
运行与带单源
实盘下单
带单组合 ID
跟单合约范围
轮询间隔(秒)
信号最大有效延迟(秒)
跟单与杠杆(币安一致)
跟单模式
跟单总资金(USDT)
定额单笔成本(USDT)
单合约最大持仓保证金(USDT)
杠杆模式
默认/固定杠杆倍数
跟随杠杆上限
止盈止损与风控
仓位止盈比例(%)
仓位止损比例(%)
项目总止损比例(%)
最大开仓滑点(%)
预留可用保证金(USDT)
单边手续费估算(%)
Related strategies
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)