| | |
| | | return datas |
| | | |
| | | |
| | | def parse_max_volume(datas, is_new_or_near_top=False): |
| | | result = __parse_max_volume(datas, is_new_or_near_top) |
| | | def parse_max_volume(code, datas, is_new_or_near_top=False): |
| | | result = __parse_max_volume(code, datas, is_new_or_near_top) |
| | | refer_index = result[3] |
| | | # 计算最低价 |
| | | refer_price = datas[refer_index]["high"] |
| | |
| | | if datas[refer_index - 1]["volume"] > datas[refer_index]["volume"]: |
| | | refer_index -= 1 |
| | | |
| | | return datas[refer_index]["volume"], datas[refer_index]["volume"], datas[refer_index]['bob'].strftime("%Y-%m-%d"), refer_index |
| | | return datas[refer_index]["volume"], datas[refer_index]["volume"], datas[refer_index]['bob'].strftime( |
| | | "%Y-%m-%d"), refer_index |
| | | |
| | | |
| | | # 返回:(60天最大量,昨日量,量参考日期,参考量据今交易日数) |
| | | def __parse_max_volume(datas, is_new_or_near_top=False): |
| | | def __parse_max_volume(code, datas, is_new_or_near_top=False): |
| | | max_volume = 0 |
| | | max_volume_date = None |
| | | max_volume_index = None |
| | |
| | | if i >= len(datas): |
| | | break |
| | | item = datas[i] |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, item["pre_close"])) |
| | | if abs(limit_up_price - item["high"]) < 0.001: |
| | | latest_limit_up_index = i |
| | | break |
| | |
| | | max_volume = volume |
| | | max_volume_date = item['bob'] |
| | | # 是否有涨停 |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, item["pre_close"])) |
| | | # 不看超过60天的涨停 |
| | | if abs(limit_up_price - item["high"]) < 0.01 and i <= 59: |
| | | if abs(limit_up_price - item["high"]) < 0.001 and i <= 59: |
| | | # 涨停 |
| | | next_volume = 0 |
| | | if i > 0: |