fix: limit klines to 1 hour, fix chart parsing string to number

- Kline data now fetches only last hour of data
- SignalChart converts string 'close' prices to numbers
This commit is contained in:
shokollm
2026-04-12 03:57:22 +00:00
parent 13e899c851
commit a253aae766
2 changed files with 15 additions and 5 deletions

View File

@@ -154,9 +154,17 @@ async def start_simulation(
# Fetch klines SYNCHRONOUSLY so user can see chart immediately
try:
token_id = f"{config.token}-{config.chain}"
# Calculate time range (last 1 hour)
import time
end_time = int(time.time() * 1000)
start_time = end_time - (60 * 60 * 1000) # 1 hour ago
klines_data = await ave_client.get_klines(
token_id,
interval=config.kline_interval,
start_time=start_time,
end_time=end_time,
limit=500
)
klines_for_chart = [