Skip to content

Commit 270c165

Browse files
authored
Merge pull request #4 from RRAaru/main
刪除多餘的程式代碼
2 parents e8a27ab + 13a61b8 commit 270c165

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

BybitPredict.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -78,35 +78,6 @@ def KLineStatus(times,Name): #呼叫實盤K線數據
7878
print("請求K線錯誤")
7979
time.sleep(3)
8080
KLineStatus(times,Name)
81-
def NKLineStatus(Name):
82-
try:
83-
session_unauth = spot.HTTP(
84-
endpoint=Bybit
85-
)
86-
data=session_unauth.latest_information_for_symbol(
87-
symbol=Name
88-
)
89-
try:
90-
with open("Ndata.json","w") as f:
91-
json.dump(data,f)
92-
with open('Ndata.json') as f:
93-
data = json.load(f)
94-
data=data.get("result")
95-
try:
96-
da=str(data).strip('{}')
97-
Del="_'!@#$%^&*()\/:*?<>|-+ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
98-
K=[]
99-
K = float(''.join( x for x in da.split(', ')[6] if x not in Del))
100-
return K
101-
except:
102-
print("拆解Ndata.json資料錯誤")
103-
except:
104-
print("建立Ndata.json錯誤")
105-
except:
106-
print("請求最新K線錯誤")
107-
time.sleep(3)
108-
NKLineStatus(Name)
109-
11081

11182
def savedata(Kline):#存取K線資料
11283
try:

0 commit comments

Comments
 (0)