コード例 #1
0
ファイル: therock.py プロジェクト: peerchemist/cryptotik
    def get_market_trade_history(self, market, depth=100):
        '''
        :return:
            list -> dict['timestamp': datetime.datetime,
                        'is_sale': bool,
                        'rate': float,
                        'amount': float,
                        'trade_id': any]
        '''

        upstream = super(TheRockNormalized,
                         self).get_market_trade_history(market, depth)
        downstream = []

        for data in upstream:

            downstream.append({
                'timestamp': self._iso_to_datetime(data['date']),
                'is_sale': is_sale(data['side']),
                'rate': data['price'],
                'amount': data['amount'],
                'trade_id': data['id']
            })

        return downstream
コード例 #2
0
ファイル: bittrex.py プロジェクト: lixiandai/cryptotik
    def get_market_trade_history(self, market):

        upstream = super().get_market_trade_history(market)
        downstream = []

        for data in upstream:

            downstream.append({
                'timestamp': self._iso_string_to_datetime(data['TimeStamp']),
                'is_sale': is_sale(data['OrderType']),
                'rate': data['Price'],
                'amount': data['Quantity'],
                'trade_id': data['Id']
            })

        return downstream
コード例 #3
0
ファイル: wex.py プロジェクト: lixiandai/cryptotik
    def get_market_trade_history(self, market):

        upstream = super().get_market_trade_history(market)
        downstream = []

        for data in upstream:

            downstream.append({
                'timestamp':
                self._tstamp_to_datetime(data['timestamp']),
                'is_sale':
                is_sale(data['type']),
                'rate':
                data['price'],
                'amount':
                data['amount'],
                'trade_id':
                data['tid']
            })

        return downstream
コード例 #4
0
    def get_market_trade_history(self, market, depth=100):

        upstream = super(PoloniexNormalized,
                         self).get_market_trade_history(market, depth)
        downstream = []

        for data in upstream:

            downstream.append({
                'timestamp':
                self._string_to_datetime(data['date']),
                'is_sale':
                is_sale(data['type']),
                'rate':
                float(data['rate']),
                'amount':
                float(data['amount']),
                'trade_id':
                data['globalTradeID']
            })

        return downstream