@@ -548,6 +548,7 @@ def toObj(self):
548
548
549
549
class _TICKER (_CSTRUCT ):
550
550
_fields_ = [("Time" , ctypes .c_ulonglong ),
551
+ ("Symbol" , ctypes .c_char * 31 ),
551
552
("Open" , ctypes .c_double ),
552
553
("High" , ctypes .c_double ),
553
554
("Low" , ctypes .c_double ),
@@ -740,10 +741,30 @@ def GetData(self, name, timeout=60000, offset=0):
740
741
EOF ()
741
742
742
743
def GetTickers (self ):
743
- return []
744
+ r_len = ctypes .c_uint (0 )
745
+ buf_ptr = ctypes .c_void_p ()
746
+ ret = self .lib .api_Exchange_GetTickers (self .ctx , self .idx , ctypes .byref (r_len ), ctypes .byref (buf_ptr ))
747
+
748
+ if ret == API_ERR_SUCCESS :
749
+ n = r_len .value
750
+ eles = []
751
+ if n > 0 :
752
+ group_array = (_TICKER * n ).from_address (buf_ptr .value )
753
+ for i in range (0 , n ):
754
+ eles .append (group_array [i ].toObj ())
755
+ self .lib .api_free (buf_ptr )
756
+ return eles
757
+ elif ret == API_ERR_FAILED :
758
+ return None
759
+ EOF ()
744
760
745
761
def GetMarkets (self ):
746
- return {}
762
+ r = ctypes .c_char_p ()
763
+ self .lib .api_Exchange_GetMarkets (self .ctx , self .idx , ctypes .byref (r ))
764
+ ret = json .loads (b2s (r .value ))
765
+ self .lib .api_free (r )
766
+ return ret
767
+
747
768
748
769
def GetTicker (self , symbol = '' ):
749
770
r = _TICKER ()
@@ -1390,7 +1411,7 @@ def __init__(self, task = None, autoRun=False, gApis = None, progressCallback=No
1390
1411
js = os .path .join (tmpCache , crcFile )
1391
1412
if os .path .exists (js ):
1392
1413
b = open (js , 'rb' ).read ()
1393
- if os .getenv ("BOTVS_TASK_UUID" ) is None or "0effa06859fb56230e100371bc1e1660 " in str (b ):
1414
+ if os .getenv ("BOTVS_TASK_UUID" ) is None or "e9706772f5c5ae0744a2a8dc6cf1e7c1 " in str (b ):
1394
1415
hdic = json_loads (b )
1395
1416
loader = os .path .join (tmpCache , soName )
1396
1417
update = False
0 commit comments