| | |
| | | codes = huaxin_target_codes_manager.HuaXinL2SubscriptCodesManager.get_subscript_codes() |
| | | if codes: |
| | | current_rate_dict = CurrentPriceManager.get_current_rate_dict() |
| | | current_price_dict = CurrentPriceManager.get_current_price_dict() |
| | | for code in codes: |
| | | deal_big_order_detail_info = None |
| | | try: |
| | |
| | | deal_big_order_info = None |
| | | code_name = gpcode_manager.get_code_name(code) |
| | | |
| | | big_order_enough = 0 |
| | | # 0 - 不够 1-即将够 2-足够 |
| | | big_order_enough_type = 0 |
| | | try: |
| | | total_deal_big_order_result = radical_buy_data_manager.get_total_deal_big_order_info(code, |
| | | gpcode_manager.get_limit_up_price_as_num( |
| | | code)) |
| | | # 取要求大单的10% |
| | | threshold_lack_money = int(round(total_deal_big_order_result[2] / 10)) |
| | | if total_deal_big_order_result and total_deal_big_order_result[0] <= threshold_lack_money: |
| | | big_order_enough = 1 |
| | | if total_deal_big_order_result: |
| | | if total_deal_big_order_result[0] <= 0: |
| | | big_order_enough_type = 2 |
| | | elif total_deal_big_order_result[0] <= threshold_lack_money: |
| | | big_order_enough_type = 1 |
| | | except: |
| | | pass |
| | | try: |
| | | is_limit_up = 1 if abs(current_price_dict.get(code, 0) - gpcode_manager.get_limit_up_price_as_num(code)) < 0.001 else 0 |
| | | except: |
| | | is_limit_up = 0 |
| | | pass |
| | | fresults.append( |
| | | (code, code_name, deal_big_order_info, deal_big_order_detail_info, big_order_enough, current_rate_dict.get(code, 0))) |
| | | (code, code_name, deal_big_order_info, deal_big_order_detail_info, big_order_enough_type, current_rate_dict.get(code, 0), is_limit_up)) |
| | | response_data = json.dumps({"code": 0, "data": fresults}) |
| | | except Exception as e: |
| | | response_data = json.dumps({"code": 1, "data": str(1)}) |