| | |
| | | |
| | | def re_set_price_pres(codes, force=False): |
| | | # 通过历史数据缓存获取 |
| | | result = HistoryKDatasUtils.get_gp_latest_info(codes) |
| | | for item in result: |
| | | symbol = item['symbol'] |
| | | symbol = symbol.split(".")[1] |
| | | pre_close = tool.to_price(decimal.Decimal(str(item['pre_close']))) |
| | | gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force) |
| | | for code in codes: |
| | | result = HistoryKDatasUtils.get_history_tick_n(code, 1) |
| | | for item in result: |
| | | symbol = item['symbol'] |
| | | symbol = symbol.split(".")[1] |
| | | pre_close = tool.to_price(decimal.Decimal(str(item['close']))) |
| | | gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force) |
| | | |
| | | |
| | | # 获取近90天的最大量与最近的量 |
| | |
| | | if d["volume"] > max_volume_info[0]: |
| | | max_volume_info = (d["volume"], d) |
| | | if max_volume_info: |
| | | return max_volume_info[0] |
| | | return None |
| | | return max_volume_info[0], max_volume_info[1]['bob'].strftime("%Y-%m-%d") |
| | | return None, None |
| | | |
| | | |
| | | # 返回:(60天最大量,昨日量,量参考日期,参考量据今交易日数) |