Add offset to "get_trades_for_order"

This commit is contained in:
Matthias 2018-09-15 20:28:36 +02:00
parent 029a6798a4
commit 9685c09c1a

View File

@ -591,7 +591,8 @@ class Exchange(object):
if not self.exchange_has('fetchMyTrades'): if not self.exchange_has('fetchMyTrades'):
return [] return []
try: try:
my_trades = self._api.fetch_my_trades(pair, since.timestamp()) # Allow 5s offset to catch slight time offsets (discovered in #1185)
my_trades = self._api.fetch_my_trades(pair, since.timestamp() - 5)
matched_trades = [trade for trade in my_trades if trade['order'] == order_id] matched_trades = [trade for trade in my_trades if trade['order'] == order_id]
return matched_trades return matched_trades