primitive.average_entry
Calculate the weighted average entry price from multiple buy/sell fills (DCA). Use when user has filled at multiple prices and asks "what's my average entry?" Returns: averagePrice, totalSize, totalCost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | ||
| symbol | Yes | Trading pair symbol, e.g. BTCUSDT | |
| contractType | No | linear = USDT-margined, average is the arithmetic mean (default). inverse = coin-margined, average is the harmonic mean (fill quantity is USD notional). | |
| exchangeCode | No | Exchange identifier (optional) |