| | |
| | | current_price = L1DataManager.get_l1_current_price(code) |
| | | if current_price: |
| | | fdata["cost_price"] = current_price |
| | | pre_close_price = CodePrePriceManager.get_price_pre_cache(code) |
| | | pre_close_price = CodePrePriceManager().get_price_pre_cache(code) |
| | | if current_price and pre_close_price: |
| | | rate = round((float(current_price) - float(pre_close_price)) / float(pre_close_price), 4) |
| | | fdata["cost_price_rate"] = rate |
| | |
| | | result = {"code": 1, "msg": "拉取K线失败"} |
| | | else: |
| | | # 更新昨日收盘价数据 |
| | | CodePrePriceManager.set_price_pre(code, volumes_data[0]['close'], force=True) |
| | | CodePrePriceManager().set_price_pre(code, volumes_data[0]['close'], force=True) |
| | | gpcode_manager.clear_limit_up_price_cache(code) |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | # 更新K线特征数据 |