 		    :price 1.31133	  
 		    :type :sell-stop		 
 		    :lots 0.1}))))
- 
+  
 (def- value-to-order-type
   {0 :buy 1 :sell 2 :buy-limit
    3 :sell-limit 4 :buy-stop

(defmethod close! :entry [{id :id :as order}] 
  (core/order-delete id)
  order)

(defmethod close! :market
  ([o] (oclose o 0))
  ([{:keys [price lots slip id] :as order} new-lots]

    true (throwf "invalid %s order with sl/tp %s/%s with price of %s" type sl tp price)))


(defn order! [{:keys [symbol type price tp sl lots slip] :as order :or {slip 3 sl 0 tp 0}}]
  (verify-order order)
  (let [id (core/order-send symbol type lots price)]
    (when (or (and sl (not (zero? sl)))
	      (and tp (not (zero? tp))))
      (core/order-modify id price sl tp))
    (merge order {:id id :slip slip :tp tp :sl sl})))
 

