update
This commit is contained in:
parent
eeebcf7e29
commit
0262e19649
@ -111,17 +111,17 @@ class BinanceAPI:
|
||||
# 转换为DataFrame
|
||||
df = pd.DataFrame(klines, columns=[
|
||||
'timestamp', 'open', 'high', 'low', 'close', 'volume',
|
||||
'close_time', 'quote_asset_volume', 'number_of_trades',
|
||||
'taker_buy_base_asset_volume', 'taker_buy_quote_asset_volume', 'ignore'
|
||||
])
|
||||
'close_time'])
|
||||
|
||||
df['format_timestamp'] = pd.to_datetime(df['timestamp'], unit='ms', utc=True).map(lambda x: x.tz_convert('Asia/Shanghai'))
|
||||
df['format_close_time'] = pd.to_datetime(df['close_time'], unit='ms', utc=True).map(lambda x: x.tz_convert('Asia/Shanghai'))
|
||||
|
||||
for col in ['open', 'high', 'low', 'close', 'volume', 'quote_asset_volume',
|
||||
'taker_buy_base_asset_volume', 'taker_buy_quote_asset_volume']:
|
||||
for col in ['open', 'high', 'low', 'close', 'volume']:
|
||||
df[col] = df[col].astype(float)
|
||||
|
||||
# 数据倒序
|
||||
df = df.iloc[::-1]
|
||||
|
||||
return df
|
||||
|
||||
except BinanceAPIException as e:
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
cryptoai-api:
|
||||
build: .
|
||||
container_name: cryptoai-api
|
||||
image: cryptoai-api:0.2.10
|
||||
image: cryptoai-api:0.2.11
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user