                             (filter #(= :sell (:action %)))
                             first)]
     (-> transaction
+        abs-items
         (assoc
           :trade-date (:transaction-date transaction)
           :action :sell
-          :shares (:quantity commodity-item)
+          :shares (.abs (:quantity commodity-item))
           :commodity-account-id (:account-id commodity-item))
         (update-in [:items] adjust-trade-actions))))
 

        (:buy actions)                :purchase
        (:split actions)              :split))))

(defmethod ^:private refine-trading-transaction :default
  [transaction]
  transaction)

(defmethod ^:private refine-trading-transaction :none [t] t)

(def ^:private trade-actions-map
  {:buy :debit


(defn- parse-decimal
  [string-decimal]
  (when-let [match (re-find #"(-?\d+)\/(\d+)" string-decimal)]
    (with-precision 12
      (apply / (->> match
                    rest
