This repository has been archived by the owner on Jun 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Normalization
i-petko edited this page Feb 19, 2018
·
12 revisions
type: dict
dict['address'] = address
{'address': 'M9gEKyoXLywuVaqtjEVaGzKXcsZVq8YaWT'}
type: list
['bcheur', 'bchusd', 'bchxbt']
type: dict
dict keys: 'ask', 'bit', 'last'
{'ask': Decimal, 'bid': Decimal, 'last': Decimal}
type bool
True
type bool
True
type: Decimal
type bool
True
type bool
True
type bool
True
type list
type list
type dict
dict keys: 'bids', 'asks'
{'bids': Decimal('315.3114365700000043708783879'), 'asks': Decimal('896.0000205000000229119128109')}
type dict
dict keys: 'bids', 'asks'
type list
Each trade in the list should be normalized to:
type dict
With fields:
dict = {
'timestamp': datetime.datetime,
'is_sale': bool,
'rate': Decimal,
'amount': Decimal,
'trade_id': any
}
Example for Bittrex:
data = Bittrex().get_trade_history('btc-etc')[0]
{
'timestamp': normalize_time(data['TimeStamp']), # datetime object
'is_sale': normalize_sale(data['OrderType']), # bool
'rate': Decimal(data['Price']), # Decimal
'amount': Decimal(data['Quantity']), # Decimal
'trade_id': data['Id'] # any
}
type float
type list
type dict
dict = {
'order_id': any,
'timestamp': datetime.datetime,
'pair': string,
'type': buy/sell,
'rate': Decimal,
'amount': Decimal,
'trade_id': any
}
type list