| | |
| | | from utils import tool, global_util |
| | | |
| | | |
| | | class RedicalBuyDataManager(): |
| | | class RadicalBuyDataManager(): |
| | | @classmethod |
| | | def can_buy(cls, code, deal_codes=None): |
| | | def is_code_can_buy(cls, code, deal_codes=None): |
| | | """ |
| | | 是否可以买 |
| | | 代码是否可以买(根据代码本身属性) |
| | | @param code: 代码 |
| | | @param total_sell_volume: 总卖量 |
| | | @return: 是否可以买, 原因 |
| | |
| | | if not k_format[13]: |
| | | return False, "近60个交易日无涨停" |
| | | if k_format[14]: |
| | | # 昨天炸板,且当前的量比小于60% |
| | | current_total_sell_data = L2MarketSellManager().get_current_total_sell_data(code) |
| | | total_sell_volume = 0 |
| | | if current_total_sell_data: |
| | | total_sell_volume = current_total_sell_data[2] |
| | | volume_rate = code_volumn_manager.CodeVolumeManager().get_volume_rate(code, total_sell_volume=total_sell_volume) |
| | | if volume_rate < 0.6: |
| | | return False, f"昨日炸板,量比({volume_rate})<0.6" |
| | | # 昨天炸板,一律不买 |
| | | return False, f"昨日炸板" |
| | | # 获取涨停价 |
| | | price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | if not price: |
| | |
| | | for dc in deal_codes: |
| | | # 获取涨停原因 |
| | | reasons = set() |
| | | # 当前的涨停原因 |
| | | limit_up_reason = kpl_data_manager.LimitUpDataConstant.get_limit_up_reason_with_history(dc) |
| | | if limit_up_reason and limit_up_reason in constant.KPL_INVALID_BLOCKS: |
| | | limit_up_reason = None |