$BTC import requests import matplotlib.pyplot as plt import numpy as np
# 1. جلب بيانات التصفية من 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"} # ضع مفتاح API الخاص بك هنا params = { "symbol": symbol, "exchange": "all", "timeType": "7d" # بيانات لمدة 7 أيام مثل لقطة الشاشة الخاصة بك }
response = requests.get(url, headers=headers, params=params) data = response.json() return data['data']
# 2. رسم خريطة كثافة (Heatmap) للتصفية def plot_liquidation_map(data): prices = data['priceList'] # مستويات الأسعار long_liq = data['longList'] # مبالغ تصفية المراكز الطويلة short_liq = data['shortList'] # مبالغ تصفية المراكز القصيرة current_price = data['currentPrice']
plt.figure(figsize=(14,7))
# رسم تصفيات المراكز القصيرة - المنطقة الحمراء على اليسار plt.bar(prices, short_liq, color='red', alpha=0.5, label='Short Liquidations')
# رسم تصفيات المراكز الطويلة - المنطقة الخضراء على اليمين plt.bar(prices, long_liq, color='green', alpha=0.5, label='Long Liquidations')
# خط سعر السوق الحالي plt.axvline(x=current_price, color='red', linestyle='--', linewidth=2, label=f'Current Price: ${current_price}')
$BNB $BNB import time import pandas as pd import ta from binance.client import Client # 1. مفاتيح API... # 2. تتبع سعر BNB/USDT #BankOfRussiaToLimitRetailCryptoFromSep1
# 2. المنطق: إذا كانت رخيصة اشترِ، وإذا كانت غالية بِع إذا rsi < 35: print("إشارة شراء - السعر منخفض") # order = client.order_market_buy(symbol=symbol, quantity=quantity)
وإلا إذا rsi > 65: print("إشارة بيع - السعر مرتفع") # order = client.order_market_sell(symbol=symbol, quantity=quantity)