rgfewfger
This commit is contained in:
18
test1.py
18
test1.py
@@ -1,3 +1,17 @@
|
||||
import random
|
||||
import time
|
||||
from binance.um_futures import UMFutures
|
||||
|
||||
print(random.random())
|
||||
client = UMFutures() # 无需key
|
||||
|
||||
while True:
|
||||
try:
|
||||
ticker = client.ticker_price("ETHUSDT")
|
||||
price = float(ticker['price'])
|
||||
print(f"ETHUSDT 永续合约当前价格: {price}")
|
||||
# 在这里加入你的判断逻辑,例如:
|
||||
# if price > 4000:
|
||||
# tu_wx1()
|
||||
except Exception as e:
|
||||
print(f"错误: {e}")
|
||||
|
||||
time.sleep(0.3) # 控制查询频率,避免被限流
|
||||
Reference in New Issue
Block a user