示例#1
0
文件: cash1.py 项目: oxmcvusd/libqda
def function_123123():
    mr = len(filteredlist)
    maxtest = 5
    test = 0

    for i in range(0, mr):
        for j in range(i+1, mr):
            test += 1
            if test > maxtest:
                return
            ar1 = libqda.get_line_arr(filteredlist[i] )
            ar2 = libqda.get_line_arr(filteredlist[j] )
            
            ar1 = sub_area(ar1)
            ar2 = sub_area(ar2)
            
            mintim1 = ar1[0]
            maxtim1 = ar1[0] + len(ar1[1]) - 1
            
            for tim1 in range( mintim1 , mintim1 ):
                
                mintim2 = ar2[0]
                maxtim2 = ar2[0] + len(ar2[1]) - 1
                
                maxdiss = -999
                
                for dv in range(-60, 0):
                    
                    tim2 = tim1 + dv
                    
                    mintim22 = tim1 + dv
                    maxtim22 = tim1 + dv + 60
                                        
                    if mintim22 < mintim2:
                        continue
                    if maxtim22 > maxtim2:
                        break
                    
                    diss = 0
                    for dv2 in range(0,60):
                        diss = diss + ar1[1][tim1+dv2] - ar2[1][tim2+dv2]
                    
                    maxdiss = max(diss, maxdiss)
                
                print "maxdiss--------------"
                print maxdiss
示例#2
0
def function_123123():
    mr = len(filteredlist)
    maxtest = 5
    test = 0

    for i in range(0, mr):
        for j in range(i + 1, mr):
            test += 1
            if test > maxtest:
                return
            ar1 = libqda.get_line_arr(filteredlist[i])
            ar2 = libqda.get_line_arr(filteredlist[j])

            ar1 = sub_area(ar1)
            ar2 = sub_area(ar2)

            mintim1 = ar1[0]
            maxtim1 = ar1[0] + len(ar1[1]) - 1

            for tim1 in range(mintim1, mintim1):

                mintim2 = ar2[0]
                maxtim2 = ar2[0] + len(ar2[1]) - 1

                maxdiss = -999

                for dv in range(-60, 0):

                    tim2 = tim1 + dv

                    mintim22 = tim1 + dv
                    maxtim22 = tim1 + dv + 60

                    if mintim22 < mintim2:
                        continue
                    if maxtim22 > maxtim2:
                        break

                    diss = 0
                    for dv2 in range(0, 60):
                        diss = diss + ar1[1][tim1 + dv2] - ar2[1][tim2 + dv2]

                    maxdiss = max(diss, maxdiss)

                print "maxdiss--------------"
                print maxdiss
示例#3
0
	def lb1_click(self,event):
			cu = self.lb1.curselection()
			
			# no selection patch
			#----------------
			if len(cu) == 0:
				cur = self.cur
			else:
				cur = int(cu[0])
				self.cur = cur

			# arr = [name,fid,cursor,daycount]

			#print "		attached to index " + str( arr_index [ cur ][ 0 ]) 
			
			target = int(self.arr_index[cur].fcursor)		
			
			print "__________________________________"
			print "60: cursor = " + str(target);
			#print "-------------"
			
			p = libqda.get_by_cursor( target )
			
			#self.cur_data = p
			
			#draw line
			
			time1 = time.time()
			
			self.line_arr = libqda.get_line_arr( p )
			
			#canv_util.canv_draw_stline(self.canv ,arr, restrict_time = self.restrict_time, fixstyle = self.fixstyle)
			wx_show_graph.show_graph(self.line_arr)
			
			arr = None

			print "   60: load time consumed : " + str(time.time() - time1)
示例#4
0
        else:
            rlist.append(k)
    return rlist


def write_result_list_to_file():
    global result_list
    f = open("Z:\\provide2.txt", "w")
    for k in result_list:
        klist = dissolve_list(k)
        klist[-1] = mod_ratio(klist[-1])
        for k1 in klist:
            f.write(str(k1))
            f.write(" ")
        f.write("\n")
    print "Write to File Finished"


libqda.qda_init()
arr_list = libqda.get_all_index_arr(filter=1)
for k in arr_list:
    if k.fid == "SH000001":
        print "found"
        dayline = libqda.get_line_arr(k)
        f1 = 4898
        f2 = f1 + 17
        print calculate_minus(dayline[12:15]) / dayline[-1][1]
        break

raw_input()
示例#5
0
                skipthis = 1
                break
        if skipthis: continue
        #print 'this is a summit'
        thissummit = dayline[i].time2000()
        #for k in range(i-bound, i+bound):
        #    print k, dayline[k].op
        #print '------', i
        result.append(thissummit)
    return result


au = get_summit(dayline, bound=100)
print au

dayline = libqda.get_line_arr(p)

wx_show_graph.set_sign_x(au)
wx_show_graph.show_graph(dayline)
'''

BELOW should be put into another cashXX I think

for i in au:
    found_a_summit_so_update_frequence(i)
    
# sumarea[i]:  length between two summit appear frequency, every col divided by 2 default
a = []
xx = []
for i in range(1, len(sumarea)):
    xx.append([i, sumarea[i]])