Closed analyticbastard closed 10 years ago
In engine.clj, the function match-once does not take into account order arrival time:
(defn match-once [book cross] (let [market-ask (:market-ask book) market-bid (:market-bid book) ask (:ask book) bid (:bid book)] (dosync (let [order-ref (if-not (empty? @market-ask) (last @market-ask) (if-not (empty? @market-bid) (last @market-bid) (if (> (apply + (map second (market-depth book :ask))) 0) (last @(best-price-level-ref book :ask)) nil)))] (if order-ref (match-order book order-ref cross) )))))
My suggestion is taking both bid and ask order side orders, compare a timestamp, then execute (match).
I consider the issue closed as per the previous commits.
In engine.clj, the function match-once does not take into account order arrival time:
My suggestion is taking both bid and ask order side orders, compare a timestamp, then execute (match).