]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/blobdiff - ccxt_wrapper.py
Merge branch 'dev'
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git] / ccxt_wrapper.py
index c4aa94d6cbe7ccfb5c9c38447bc9b59162a1bbe0..aaccc612ba036ff92123d377aed2ff208c02725d 100644 (file)
@@ -299,6 +299,10 @@ class poloniexE(poloniex):
                 "total": decimal.Decimal(summary["totalValue"]),
                 }
 
+    def fetch_nth_order_book(self, symbol, action, number):
+        book = self.fetch_order_book(symbol, limit=number)
+        return decimal.Decimal(book[action + "s"][-1][0])
+
     def nonce(self):
         """
         Wrapped to allow nonce with other libraries