!-- flowchart 箭头图标 勿删 --
import time
from jiJingTest import getRealTimeData
class shareList(object):
def __init__(self,code,buy,sale):
self.stockName = ""
self.price = ""
self.high = ""
self.low = ""
self.volumn = ""
self.amount = ""
self.openToday = ""
self.preClose = ""
self.timee = ""
self.dec =""
self.code= code
self.buy=buy
self.sale=sale
class maina(object):
def main(shareList):
for share in shareList:
sss=getRealTimeData(share)
if sss.price<=float(sss.buy):
print(sss.dec,"达到买入...")
elif sss.price>=float(sss.sale):
print(sss.dec,"达到卖出...")
else:
print(sss.dec,"数据监控中...")
while 1==1:
share1=shareList("600106",3.6,3.8)
share2 = shareList("600116", 3.6, 3.8)
share3 = shareList("000591", 3.6, 3.8)
list1=[share1,share2,share3]
print("---------------")
maina.main(list1)
time.sleep(5)
import