Price source (ps=), by exchange
A limit order needs a price, and p= is an offset from some starting point. Without ps=, that starting point is the current bid or ask. ps=position moves it to your open position's entry price, so a close can sit a set distance from where you got in. Autoview reads two values: position and, on Bitfinex only, last. Any other value is ignored.
This page comes from the Autoview integrations code that runs on our servers today. We read the code; we did not send these orders live for this guide.
Where ps=position is read
ps=position only matters when Autoview is working from an open position: a c=position close, or an add with opposite=0. On a plain new order there is no position to measure from, so it does nothing.
| Exchange | Price it measures from | Is p= added? |
|---|---|---|
| Binance Futures, Binance Delivery | The position's entry price | Yes |
| HTX (Huobi) Futures, Linear and Swap | The position's average cost | Yes |
| OKX | The position's average price | Yes |
| Bitget, Bybit, Kraken Futures | The position's average price | No, the order sits at that price |
| BitMEX | The position's break-even price | No, the order sits at that price |
| Other exchanges with a c=position close | The position price the exchange reports | Depends on the exchange; test with d=1 |
Here "Yes" means the close goes out at the position price plus your p=. A fixed fp= still wins over both: it is the exact price, and p= is not used.
Exchange by exchange
- Binance Futures and Binance Delivery. These have their own close step. With
ps=position,p=is measured from the position's entry price. The same happens whenever the close line carriessl=ortp=, even withoutps=. - HTX (Huobi) Futures, Linear and Swap. Their own close step measures
p=from the position's average cost whenps=positionis set, and from the bid or ask otherwise. A stop loss attached to the close measures from the same price. - OKX. Its own close step measures
p=from the position's average price withps=position. - Bitget, Bybit, Kraken Futures and BitMEX. These close through Autoview's shared close step, which hands the position price on as the order price. Their order builders take that price as it is, so the close is placed exactly at the position's price and your
p=offset is dropped. On BitMEX that price is the break-even price, not the average entry. - Bybit and Capital.com with stops. A
c=positionline that carriessl=,tp=orts=(and on Bybit alsopx=) does not close anything. It sets those levels on the open position. Withps=positionthe offsets are measured from the entry price instead of the current price. See edit open orders by exchange. - Bitfinex.
ps=positionon a close measures from the position's base price. Bitfinex is also the only exchange that readsps=last: new orders and closes are priced from the last trade instead of the bid or ask.
On the other exchanges that close through the shared step (Alpaca, Capital.com, Charles Schwab, Crypto.com, Deribit, Gate.io Futures, Hyperliquid, Kraken, KuCoin Futures, OANDA, TradeStation and Tradovate), ps=position passes on the position price in the same way. Whether p= is added on top depends on how each one builds its order, and we have not mapped each of them here.
An example
e=okx s=BTC-USDT-SWAP b=long c=position ps=position p=2% d=1That closes the whole long on OKX with a limit 2% above the position's average price, as a d=1 test. Without ps=position, the 2% would be measured from the current price instead.
Test it once before you rely on it
Add d=1 and send the line. The log shows the order Autoview would send, with its price. Check that price against your entry, especially on Bitget, Bybit, Kraken Futures and BitMEX, where an offset does not move it. For closing in general, see close or reverse on an opposite signal, and for adding at a price below your entry, see add to an open position.