Example #1
0
    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
Example #2
0
    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
Example #3
0
    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
Example #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