added coin API WS implementation
This commit is contained in:
@ -356,7 +356,8 @@ class COBDashboardServer:
|
||||
if mid_price <= 0:
|
||||
return
|
||||
|
||||
now = datetime.now()
|
||||
from datetime import timezone
|
||||
now = datetime.now(timezone.utc)
|
||||
current_second = now.replace(microsecond=0)
|
||||
|
||||
# Get or create current candle
|
||||
@ -377,7 +378,7 @@ class COBDashboardServer:
|
||||
if current_second > current_candle['timestamp']:
|
||||
# Close previous candle
|
||||
finished_candle = {
|
||||
'timestamp': current_candle['timestamp'].isoformat(),
|
||||
'timestamp': current_candle['timestamp'].isoformat(), # UTC ISO8601
|
||||
'open': current_candle['open'],
|
||||
'high': current_candle['high'],
|
||||
'low': current_candle['low'],
|
||||
|
Reference in New Issue
Block a user