cleanup new COB ladder

This commit is contained in:
Dobromir Popov
2025-07-22 21:39:36 +03:00
parent 153ebe6ec2
commit 55803c4fb9
33 changed files with 125 additions and 90096 deletions

View File

@ -4516,9 +4516,9 @@ class CleanTradingDashboard:
import requests
import time
# Use Binance REST API for order book data
# Use Binance REST API for order book data with maximum depth
binance_symbol = symbol.replace('/', '')
url = f"https://api.binance.com/api/v3/depth?symbol={binance_symbol}&limit=500"
url = f"https://api.binance.com/api/v3/depth?symbol={binance_symbol}&limit=1000"
response = requests.get(url, timeout=5)
if response.status_code == 200:
@ -4528,8 +4528,8 @@ class CleanTradingDashboard:
bids = []
asks = []
# Process bids (buy orders)
for bid in data['bids'][:100]: # Top 100 levels
# Process bids (buy orders) - increased to 500 levels for better bucket filling
for bid in data['bids'][:500]: # Top 500 levels
price = float(bid[0])
size = float(bid[1])
bids.append({
@ -4538,8 +4538,8 @@ class CleanTradingDashboard:
'total': price * size
})
# Process asks (sell orders)
for ask in data['asks'][:100]: # Top 100 levels
# Process asks (sell orders) - increased to 500 levels for better bucket filling
for ask in data['asks'][:500]: # Top 500 levels
price = float(ask[0])
size = float(ask[1])
asks.append({