def electrocardiograpy_index_red(request): results = get_losing_data(50, "dict") dictS=results[0].copy() del dictS['termnum'] sortResult=sorted(dictS.items(), key=lambda d:d[1], reverse = True) currentLosingResultList=[] for value in sortResult: currentLosingResult = {} currentLosingResult['Num']=value[0][-2:] currentLosingResult['Amount'] = value[1] currentLosingResultList.append(currentLosingResult) resultsBlue = get_losing_data_blue(50) context = {'num_list': results,'sortResult':currentLosingResultList, 'num_list_blue': resultsBlue} return render(request, 'electrocardiograpy_index_red.html',context)
def midAnalysis(request): results = get_losing_data(30) # 趋势反转分析 num_list_revert = getTrendReversalNum(results) # 升三浪分析 num_list_up = getUpThreeWaveNum(results) # 降三浪分析 num_list_down = getDownThreeWaveNum(results) # 双底分析 num_list_double_bottom = getDoubleBottom(results) # num_list_revert=[1,2,3] # num_list_up = [4, 2, 3] # num_list_down = [5, 2, 3] ret = {'num_list_revert': num_list_revert, 'num_list_up': num_list_up,'num_list_down': num_list_down,'num_list_double_bottom':num_list_double_bottom} return HttpResponse(json.dumps(ret), content_type='application/json')
analysisInfo['shengsanlangInfo'] = msg return trend_num_list def getConditionByUpThreeWaveNum(args={}, results=(), analysisInfo={}): trend_num_list = [] for index, value in enumerate(results[len(results) - 1]): if value in range(9, 12): section_02_value = results[len(results) - value - 2][index] if section_02_value in range(4, 9): section_03_value = results[len(results) - value - 2 - section_02_value - 1][index] if section_03_value in range(1, 4): trend_num_list.append(index + 1) if len(trend_num_list) == 0: msg = "升三浪分析,没有处于该趋势的号码" print(msg) analysisInfo['shengsanlangInfo'] = msg else: msg = "升三浪分析,正处于该趋势的号码为:" + str(trend_num_list) print(msg) analysisInfo['shengsanlangInfo'] = msg args['midallssqdata__num__in'] = args[ 'midallssqdata__num__in'] + trend_num_list return trend_num_list if __name__ == '__main__': results = get_losing_data() # results=((1,2,1,1,1),(2,3,1,1,8),(3,0,1,1,0),(0,0,1,1,1),(1,1,1,1,1),(2,2,1,1,1),(3,0,1,1,1),(4,1,1,1,1),(5,2,1,1,1),(0,3,1,8,7),(1,4,1,0,0),(2,0,1,1,1),(3,1,1,1,1),(4,2,1,1,1),(5,3,1,1,1),(6,4,1,1,1),(7,5,1,1,1),(8,6,1,1,1),(9,7,1,1,1),(10,8,1,1,1),(11,9,10,10,10)) analyzeByUpThreeWave(results)
def mid(request): results = get_losing_data(50, "dict") resultsBlue = get_losing_data_blue(50) context = {'num_list': results, 'num_list_blue': resultsBlue} return render(request, 'mid.html', context)
def downThreeWavesAnalysis(request): results = get_losing_data(20) # 降三浪分析 num_list = getDownThreeWaveNum(results) return HttpResponse(json.dumps(num_list), content_type='application/json')
def tendencyRevertAnalysis(request): results = get_losing_data(20) # 趋势反转分析 num_list = getTrendReversalNum(results) return HttpResponse(json.dumps(num_list), content_type='application/json')