fixing logic in getTradeOrder