sellAmount

Generates a new sell order

(sellAmount {asset} amount options?)

Returns

The sellAmount function returns an order object containing information about the sell action. If the order is not generated due to existing open positions, it may return null

Parameters

{asset} (asset) - asset to be sold

amount (number) - amount to be sold

options (object) - round: only hole shares - target: checks openPositions and generates order to balance portfolio

Examples

(sellAmount {AAPL} 200)            ;; sells 1.29 shares of AAPL if price is 155
;;=> order {symbol: "AAPL", action: "sell", units: 1.29, ....}

(sellAmount {AAPL} 200 {round: true})    ;; sells 1 shares of AAPL if price is 155
;;=> order {symbol: "AAPL", action: "sell", units: 1, ....}

Was this helpful?