$BTC nhập requests import matplotlib.pyplot as plt import numpy as np
# 1. Lấy dữ liệu thanh lý từ CoinGlass API def get_liquidation_data(symbol="BTC"): url = "https://open-api.coinglass.com/api/futures/liquidation/chart" headers = {"coinglass-api-key": "YOUR_API_KEY"} # Dán API key của bạn vào đây params = { "symbol": symbol, "exchange": "all", "timeType": "7d" # Dữ liệu 7 ngày như ảnh chụp màn hình của bạn }
response = requests.get(url, headers=headers, params=params) data = response.json() return data['data']
# 2. Vẽ biểu đồ nhiệt thanh lý def plot_liquidation_map(data): prices = data['priceList'] # Các mức giá long_liq = data['longList'] # Giá trị thanh lý Long short_liq = data['shortList'] # Giá trị thanh lý Short current_price = data['currentPrice']
plt.figure(figsize=(14,7))
# Vẽ thanh lý Short - Khu vực màu đỏ ở bên trái plt.bar(prices, short_liq, color='red', alpha=0.5, label='Short Liquidations')
# Vẽ thanh lý Long - Khu vực màu xanh lá ở bên phải plt.bar(prices, long_liq, color='green', alpha=0.5, label='Long Liquidations')
# Đường giá hiện tại plt.axvline(x=current_price, color='red', linestyle='--', linewidth=2, label=f'Current Price: ${current_price}')
$ETH ETH đang xanh, Samsung & Apple đang đỏ 📉📈 Hôm nay ai đang thắng? Bầu chọn ngay 👇 #ETH🔥🔥🔥🔥🔥🔥 $SAMSUNGEM ETH đang xanh, Samsung & Apple đang đỏ 📉📈 Hôm nay ai đang thắng? Bầu chọn ngay 👇 #ETH #AAPL #SAMSUNGEMUSDT
$AAPL.US ETH đang xanh, Samsung & Apple đang đỏ 📉📈 Hôm nay ai đang thắng? Bầu chọn ngay 👇 #AAPL
$BNB $BNB nhập thời gian nhập pandas as pd nhập ta from binance.client import Client # 1. Khóa API... # 2. Theo dõi giá BNB/USDT #BankOfRussiaToLimitRetailCryptoFromSep1
# 2. Logic: Thấy rẻ thì mua, thấy đắt thì bán if rsi < 35: print("Tín hiệu Mua - Giá Thấp") # order = client.order_market_buy(symbol=symbol, quantity=quantity)
elif rsi > 65: print("Tín hiệu Bán - Giá Cao") # order = client.order_market_sell(symbol=symbol, quantity=quantity)