File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
11182def savedata (Kline ):#存取K線資料
11283 try :
You can’t perform that action at this time.
0 commit comments