This commit is contained in:
aaron 2025-05-18 09:59:30 +08:00
parent e3a4cd281a
commit a476ae939c
2 changed files with 10 additions and 10 deletions

View File

@ -40,17 +40,17 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit:
symbol = symbol + "USDT" symbol = symbol + "USDT"
binance_api = get_binance_api() binance_api = get_binance_api()
result = {}
kline = binance_api.get_historical_klines(symbol=symbol, interval=timeframe, limit=limit, ts_transform=False).to_dict(orient="records")
# data_processor = DataProcessor()
# result = data_processor.add_technical_indicators(kline).to_dict(orient="records") if timeframe is None:
result["1h"] = binance_api.get_historical_klines(symbol=symbol, interval="1h", limit=limit, ts_transform=False).to_dict(orient="records")
print(f"total kline: {len(kline)}") result["4h"] = binance_api.get_historical_klines(symbol=symbol, interval="4h", limit=limit, ts_transform=False).to_dict(orient="records")
result["1d"] = binance_api.get_historical_klines(symbol=symbol, interval="1d", limit=limit, ts_transform=False).to_dict(orient="records")
return kline result["1w"] = binance_api.get_historical_klines(symbol=symbol, interval="1w", limit=limit, ts_transform=False).to_dict(orient="records")
else:
result[timeframe] = binance_api.get_historical_klines(symbol=symbol, interval=timeframe, limit=limit, ts_transform=False).to_dict(orient="records")
return result
@router.post("/analysis_v2") @router.post("/analysis_v2")
async def analysis_crypto_v2(request: CryptoAnalysisRequest, async def analysis_crypto_v2(request: CryptoAnalysisRequest,

View File

@ -29,7 +29,7 @@ services:
cryptoai-api: cryptoai-api:
build: . build: .
container_name: cryptoai-api container_name: cryptoai-api
image: cryptoai-api:0.1.5 image: cryptoai-api:0.1.6
restart: always restart: always
ports: ports:
- "8000:8000" - "8000:8000"