Partial closes by exchange
Scaling out means closing part of a trade and letting the rest run. In Autoview you do it with c=position and a q= that is a share of what you hold. This alert closes half of an open long:
c=position b=long q=50%This page lists where that works, where c=position is refused, and the venue rules that change what the close does. It comes from the Autoview integrations code that runs on our servers today, read venue by venue.
How q= works on a close
- A percentage is a share of the position.
q=50%closes half,q=25%a quarter. Leaveq=off and Autoview closes all of it, because the default is100%. - The share is rounded down to whole order units. Autoview cuts a percentage down to the venue's smallest order size, which on futures is one contract.
q=50%of 3 contracts closes 1.q=50%of a single contract rounds to 0: on Binance Futures nothing is closed and your log says so, and on Tradovate the order goes out for 0 contracts, so it cannot close anything. To close a 1-lot, useq=100%or a plain number. - A plain number is an amount.
q=1closes one unit or contract. Autoview sends the number as written and does not trim it to the size of your position, so use a percentage when you mean part of what you hold. - b= picks the side.
b=longcloses longs,b=shortcloses shorts. Without it, Autoview closes the matching positions on both sides.
Exchanges where a partial close works
On these venues c=position closes open positions, and q=50% closes half of each one it touches, rounded down to the venue's order size:
- Alpaca
- Binance Futures and Binance Delivery
- Bitfinex (margin and derivatives)
- Bitget Mix
- Bybit (derivatives)
- Capital.com
- Charles Schwab
- Crypto.com
- Deribit
- Gate.io Futures
- HTX Linear, HTX Swap and HTX Futures
- HyperLiquid
- Kraken (margin positions) and Kraken Futures
- Kucoin Futures
- OANDA
- OKX
- TradeStation
- Tradovate
Venue rules to know
- Capital.com: a full close uses Capital.com's own close, which takes no size. Any other
q=goes out as an offsetting order for that amount. On an instrument that only allows long (or only short) exposure, Capital.com rejects that offsetting order, so a partial close fails there while a full close still works. The Capital.com command reference has the rest. - Capital.com and Bybit, with sl= or tp= on the close: if the
c=positionalert also carries a stop loss, take profit or trailing stop (and on Bybit,px=), Autoview moves those orders on the open position instead of closing it. Keep the close alert free of them, or addedit=0. - Binance Futures: if the share you ask for rounds below the symbol's smallest order size, nothing is closed and your log says so.
- Kraken:
c=positioncloses margin positions. A spot coin balance is not a position, so it is not touched. - OANDA: the close goes out with OANDA's reduce-first position fill, so it shrinks the open position rather than opening a new one alongside it. Keep
&off the close alert: on OANDA,c=positionwith an&closes nothing and only sets or moves the stops and targets on each open trade (OANDA command reference).
Exchanges where c=position is refused
These spot connectors stop the alert with an unsupported feature error when they see c=position:
- Binance (spot) and Binance.US
- Bitget (spot)
- Bybit (spot)
- Coinbase Advanced
- Gate.io (spot)
- Gemini
- HTX (spot)
- Kucoin (spot)
On spot you hold a coin balance, not a position. To take some profit, send a normal sell order for the amount you want to let go. The command reference covers how q= sizes a plain order.
Closing some positions but not others: cm= and cmo=
When more than one position matches, cm= caps how many get closed: cm=1 closes one. When cm= is lower than the number of matching positions, cmo= picks which ones, and the default is oldest. The choices are newest, oldest, highest, lowest, biggest, smallest and random.
Some venues do not report when a position was opened, so oldest and newest cannot work there. On those the alert stops with a "does not support sort method" error, and that includes the default. Add another cmo= value, such as cmo=biggest. This applies to:
- Alpaca
- Binance Futures and Binance Delivery
- Bitfinex
- Charles Schwab
- Deribit
- Gate.io Futures
- HTX Linear, HTX Swap and HTX Futures
- HyperLiquid
Test it once before you rely on it
Add d=1 to the alert first. Autoview writes what it would send to your log and places nothing, so you can check the size of the close against your position, and that it is not 0. When the log looks right, take d=1 off. The log guide shows where to look. To stop a repeated exit from opening a new position, see reduce-only orders by exchange. To scale out with several targets set at entry instead, see the & separator by exchange. To close and then go the other way, see close or reverse on an opposite signal.