custom sorting of trades issue #316