MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetch_my_trades

Method fetch_my_trades

python/ccxt/bit2c.py:730–793  ·  view source on GitHub ↗

fetch all trades made by the user https://bit2c.co.il/home/api#orderh :param str symbol: unified market symbol :param int [since]: the earliest time in ms to fetch trades for :param int [limit]: the maximum number of trades structures to retrieve :p

(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})

Source from the content-addressed store, hash-verified

728 }, market)
729
730 def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
731 """
732 fetch all trades made by the user
733
734 https://bit2c.co.il/home/api#orderh
735
736 :param str symbol: unified market symbol
737 :param int [since]: the earliest time in ms to fetch trades for
738 :param int [limit]: the maximum number of trades structures to retrieve
739 :param dict [params]: extra parameters specific to the exchange API endpoint
740 :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/?id=trade-structure>`
741 """
742 self.load_markets()
743 market = None
744 request = {}
745 if limit is not None:
746 request['take'] = limit
747 request['take'] = limit
748 if since is not None:
749 request['toTime'] = self.yyyymmdd(self.milliseconds(), '.')
750 request['fromTime'] = self.yyyymmdd(since, '.')
751 if symbol is not None:
752 market = self.market(symbol)
753 request['pair'] = market['id']
754 response = self.privateGetOrderOrderHistory(self.extend(request, params))
755 #
756 # [
757 # {
758 # "ticks":1574767951,
759 # "created":"26/11/19 13:32",
760 # "action":1,
761 # "price":"1000",
762 # "pair":"EthNis",
763 # "reference":"EthNis|10867390|10867377",
764 # "fee":"0.5",
765 # "feeAmount":"0.08",
766 # "feeCoin":"₪",
767 # "firstAmount":"-0.015",
768 # "firstAmountBalance":"9",
769 # "secondAmount":"14.93",
770 # "secondAmountBalance":"130,233.28",
771 # "firstCoin":"ETH",
772 # "secondCoin":"₪"
773 # },
774 # {
775 # "ticks":1574767951,
776 # "created":"26/11/19 13:32",
777 # "action":0,
778 # "price":"1000",
779 # "pair":"EthNis",
780 # "reference":"EthNis|10867390|10867377",
781 # "fee":"0.5",
782 # "feeAmount":"0.08",
783 # "feeCoin":"₪",
784 # "firstAmount":"0.015",
785 # "firstAmountBalance":"9.015",
786 # "secondAmount":"-15.08",
787 # "secondAmountBalance":"130,218.35",

Callers

nothing calls this directly

Calls 7

parse_tradesMethod · 0.80
load_marketsMethod · 0.45
yyyymmddMethod · 0.45
millisecondsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected