⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
erol
/
View File Name :
test2.py
import json from binance.client import Client import redis # Binance API istemcisini oluşturun r=redis.Redis() # Limit emri parametreleri symbol = "XVSUSDT" # İşlem yapılacak çift side = Client.SIDE_BUY # Alım emri quantity = 1.2 # Miktar price = 4.6000 # Fiyat s_price=3.0 # Limit emri oluştur def create_futures_client(): if r.hexists("ayarlar", "binanceapikey") and r.hexists("ayarlar", "binancesecretkey"): return Client(r.hget("ayarlar", "binanceapikey").decode("utf-8"), r.hget("ayarlar", "binancesecretkey").decode("utf-8")) client = create_futures_client() long_profit_key = "L_unRealizedProfit" short_profit_key = "S_unRealizedProfit" # Belirli sembolün hash verisini al symbol_data = r.hget("symbols", symbol) if symbol_data: symbol_data = json.loads(symbol_data) if long_profit_key in symbol_data or short_profit_key in symbol_data: print("Veri bulundu:", symbol_data) else: print("Veri bulunamadı.") else: print("Sembol verisi bulunamadı.") def limit_al(client,symbol,positionSide,quantity,price): order = client.futures_create_order( symbol=symbol, side=Client.SIDE_BUY if positionSide=="LONG" else Client.SIDE_SELL, positionSide=positionSide, quantity=quantity, timeInForce = Client.TIME_IN_FORCE_GTC, type=Client.FUTURE_ORDER_TYPE_STOP, price = price, stopPrice = price ) def pozisyon_ac(client,symbol,quantity): order_long = client.futures_create_order( symbol=symbol, side="BUY", positionSide="LONG", quantity=quantity, type=Client.ORDER_TYPE_MARKET ) order_short = client.futures_create_order( symbol=symbol, side="SELL", positionSide="SHORT", quantity=quantity, type=Client.ORDER_TYPE_MARKET ) #limit_al(client,symbol,"LONG",quantity,price) #limit_al(client,symbol,"SHORT",quantity,s_price) #print(order)