def setUp(self): #prepare data sopen = np.array([randint(10000, 15000) for i in range(2000)]) sclose = np.array([randint(10000, 15000) for i in range(2000)]) svolume = np.array([randint(1000, 15000) for i in range(2000)]) shigh = np.max(np.array([sopen, sclose]), axis=0) slow = np.max(np.array([sopen, sclose]), axis=0) savg = sopen + sclose / 2 samount = svolume * sopen / 1000 trans = [sopen, sclose, svolume, shigh, savg, samount, svolume] g5 = np.array([randint(0, 10000) for i in range(2000)]) g20 = np.array([randint(0, 10000) for i in range(2000)]) g60 = np.array([randint(0, 10000) for i in range(2000)]) g120 = np.array([randint(0, 10000) for i in range(2000)]) g250 = np.array([randint(0, 10000) for i in range(2000)]) s = BaseObject(code='SH00TEST', transaction=trans, g5=g5, g20=g20, g60=g60, g120=g120, g250=g250) s.catalog = {s: g5} s.c60 = {s: g5} self.stock = s
def setUp(self): #prepare data sopen = sclose = svolume = shigh = slow = savg = samount = np.array( [randint(10000, 15000) for i in range(2000)]) shour = np.array([randint(10000, 15000) for i in range(8000)]) trans = [sopen, sclose, svolume, shigh, savg, samount, svolume] vi = np.array([i for i in range(2000)]) g = np.array([randint(0, 10000) for i in range(2000)]) s = BaseObject(code='SH50TEST', zgb=10000000, ag=4000, transaction=trans, atr=g, atr2=g, silver=g, g5=g, g20=g, g60=g, g120=g, g250=g, diff=g, dea=g, mfilter=g, ma0=g, ma1=g, ma2=g, ma3=g, ma4=g, ma5=g, t5=g, t4=g, t3=g, t2=g, t1=g, t0=g, above=g, golden=g, thumb=g, magic=g, hour=shour, hmxc=g, xru3=g, xru=g, ma4_up=g, hup=g, hdown=g, hdev=g, mup_100=g, svap_ma_67=(g, vi), svap_ma_67_2=(g, vi), i_cofw=np.arange(0, 2000, 5)) s.ref = s #指向自己 s.catalog = {s: g} s.c60 = {s: g} self.stock = s
def setUp(self): #prepare data sopen = sclose = svolume = shigh = slow = savg = samount = np.array([randint(10000,15000) for i in range(2000)]) shour = np.array([randint(10000,15000) for i in range(8000)]) trans = [sopen,sclose,svolume,shigh,savg,samount,svolume] vi = np.array([i for i in range(2000)]) g = np.array([randint(0,10000) for i in range(2000)]) s = BaseObject(code='SH50TEST',zgb=10000000,ag=4000,transaction=trans, atr=g,atr2=g,silver=g,g5=g,g20=g,g60=g,g120=g,g250=g,diff=g,dea=g, mfilter = g, ma0=g,ma1=g,ma2=g,ma3=g,ma4=g,ma5=g,t5=g,t4=g,t3=g,t2=g,t1=g,t0=g,above=g,golden=g,thumb=g,magic=g, hour=shour,hmxc=g,xru3=g,xru=g,ma4_up=g,hup=g,hdown=g,hdev=g,mup_100=g, svap_ma_67=(g,vi),svap_ma_67_2=(g,vi), i_cofw = np.arange(0,2000,5) ) s.ref = s #指向自己 s.catalog = {s:g} s.c60 = {s:g} self.stock = s
def setUp(self): #prepare data sopen = np.array([randint(10000,15000) for i in range(2000)]) sclose = np.array([randint(10000,15000) for i in range(2000)]) svolume = np.array([randint(1000,15000) for i in range(2000)]) shigh = np.max(np.array([sopen,sclose]),axis=0) slow = np.max(np.array([sopen,sclose]),axis=0) savg = sopen + sclose / 2 samount = svolume * sopen /1000 trans = [sopen,sclose,svolume,shigh,savg,samount,svolume] g5 = np.array([randint(0,10000) for i in range(2000)]) g20 = np.array([randint(0,10000) for i in range(2000)]) g60 = np.array([randint(0,10000) for i in range(2000)]) g120 = np.array([randint(0,10000) for i in range(2000)]) g250 = np.array([randint(0,10000) for i in range(2000)]) s = BaseObject(code='SH00TEST',transaction=trans,g5=g5,g20=g20,g60=g60,g120=g120,g250=g250) s.catalog = {s:g5} s.c60 = {s:g5} self.stock = s