| | |
| | | # 涨停过的代码才会计算板块身位 |
| | | for b in blocks: |
| | | index = None |
| | | |
| | | # 如果当前板块不能买则不订阅 |
| | | if not radical_buy_data_manager.is_can_buy_for_forbidden_plate(code, b, yesterday_limit_up_codes): |
| | | continue |
| | | if b in top_in_blocks: |
| | | index = top_in_blocks.index(b) |
| | | else: |
| | | if RadicalBuyBlockManager.is_block_can_buy_with_block_in(code, b, |
| | | yesterday_limit_up_codes=yesterday_limit_up_codes)[ |
| | | 0]: |
| | | index = 100 |
| | | if index is None: |
| | | continue |
| | | # 查询在板块中的排序 |
| | | info = RadicalBuyBlockManager().get_history_index(code, b, yesterday_limit_up_codes) |
| | | if info[0] > 0: |
| | | info = RadicalBuyBlockManager().filter_before_codes(code, b, info[0], info[1], |
| | | yesterday_limit_up_codes) |
| | | if info[0] < 3: |
| | | return index + 1 |
| | | else: |
| | | # 判断是否具有辨识度 |
| | | special_codes = BlockSpecialCodesManager().get_block_codes(b) |
| | | if special_codes and code in special_codes: |
| | | # 只订阅有辨识度的票和新板块前3 |
| | | special_codes = BlockSpecialCodesManager().get_block_codes(b) |
| | | if special_codes and code in special_codes: |
| | | # 有辨识度在净流入中则订阅 |
| | | if b in top_in_blocks: |
| | | index = top_in_blocks.index(b) |
| | | return index + 1 |
| | | else: |
| | | # 没有辨识度,新板块订阅前3 |
| | | new_blocks = LimitUpCodesBlockRecordManager().get_new_blocks() |
| | | if new_blocks and b in new_blocks: |
| | | info = RadicalBuyBlockManager().get_history_index(code, b, yesterday_limit_up_codes) |
| | | if info[0] > 0: |
| | | info = RadicalBuyBlockManager().filter_before_codes(code, b, info[0], info[1], |
| | | yesterday_limit_up_codes) |
| | | if info[0] < 3: |
| | | if b in top_in_blocks: |
| | | index = top_in_blocks.index(b) |
| | | return index + 1 |
| | | else: |
| | | return 200 |
| | | else: |
| | | # 尚未涨停过的代码,订阅板块有辨识度的前6 |
| | | for b in blocks: |
| | | # 如果当前板块不能买则不订阅 |
| | | if not radical_buy_data_manager.is_can_buy_for_forbidden_plate(code, b, yesterday_limit_up_codes): |
| | | continue |
| | | if b not in top_in_blocks: |
| | | continue |
| | | index = top_in_blocks.index(b) |
| | |
| | | # 创业板的涨幅需要打折 |
| | | rate = rate / 2 |
| | | if order_index >= 0: |
| | | if order_index < 1000 and rate >= 5: |
| | | # 涨幅大于5%的才能订阅 |
| | | if order_index < 1000 and rate >= 3: |
| | | # 涨幅大于3%的才能订阅 |
| | | _code_list.append((rate, code, order_index)) |
| | | else: |
| | | _delete_list.append((rate, code, 0)) |