INNER CODE UNIT · Python
history
ibaihuo/chanvis · api/chanapi.py:97
def history():
"""
历史数据
/history?symbol=<ticker_name>&from=<unix_timestamp>&to=<unix_timestamp>&resolution=<resolution>
"""
symbol = request.args.get('symbol', 'BTC')
from_ = int(request.args.get('from', None))
to_ = int(request.args.get('to', None))
resolution = request.args.get('resolution', 'D')
tf = RESOU_DICT[resolution]
db = HIST_DB
conf_db = CONF_DB
if re.match(r'\d{6}', symbol):
# 股票的代码
db = STOCK_DB