MCPcopy
hub / github.com/owocki/pytrader / get_exchange_rate_btc_to_usd

Function get_exchange_rate_btc_to_usd

history/tools.py:86–93  ·  view source on GitHub ↗
(d=None)

Source from the content-addressed store, hash-verified

84
85
86def get_exchange_rate_btc_to_usd(d=None):
87 from history.models import Price
88 if d is None:
89 d = datetime.datetime.now()
90
91 exchange_pair = 'USDT_BTC'
92 latest_price = Price.objects.filter(symbol=exchange_pair, created_on__lt=d).order_by('-created_on').first()
93 return latest_price.price
94
95
96def get_cost_basis(total_amount, symbol):

Callers 4

handleMethod · 0.90
get_deposit_balanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected