closePositions

Generates buy/sell orders to close provided positions

(closePositions positions)

Returns

An array with orders

Parameters

positions (array) - an array with positions to be closed

Examples

(closePositions )              ;; will close all positions
;;=> [{symbol: 'AAPL', ...}]

(defn filterMSFT [p] (= "MSFT" (:symbol p)))
(def msft (filter filterMSFT openPositions)

;; will close MSFT positions
(closePositions msft)            
;;=> [{symbol: 'MSFT', ...}]

Was this helpful?