Administrator
2023-12-28 a9768674e4ef88f3e72b200c7cf35a0b8735d6f3
开盘啦原因输出
1个文件已修改
2个文件已添加
52 ■■■■■ 已修改文件
l2/l2_data_manager_new.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/feed_analysis.py 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/buy_condition_util.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py
@@ -679,7 +679,7 @@
                        if not can_buy_result[0] and can_buy_result[1]:
                            info.set_kpl_match_blocks(["独苗"])
                        elif not can_buy_result[0] and not can_buy_result[1]:
                            info.set_kpl_match_blocks("非独苗不满足身位")
                            info.set_kpl_match_blocks(["非独苗不满足身位"])
                        else:
                            info.set_kpl_match_blocks(can_buy_result[0])
                    trade_record_log_util.add_place_order_log(code, info)
third_data/feed_analysis.py
New file
@@ -0,0 +1,37 @@
# 获取首板溢价率
import json
from third_data import kpl_api, kpl_util
from third_data.history_k_data_util import HistoryKDatasUtils
from utils import tool
def getFirstLimitUpPremium(day):
    results = kpl_api.getHistoryLimitUpInfo(day)
    # 获取下一个交易日
    next_day = HistoryKDatasUtils.get_next_trading_date(day)
    result_list = kpl_util.parseDaBanData(json.dumps({"list": results, "errcode": 0}), kpl_util.DABAN_TYPE_LIMIT_UP)
    target_codes = set()
    for result in result_list:
        if not tool.is_shsz_code(result[0]):
            continue
        if result[4] != '首板':
            continue
        target_codes.add(result[0])
        # TODO 获取涨停日的收盘价
        # 获取k线
        open_price = None
        high_price = None
        if tool.get_now_date_str() == next_day:
            records = HistoryKDatasUtils.get_gp_current_info([result[0]])
            print(records)
        else:
            records = HistoryKDatasUtils.get_history_tick_n(result[0], 15)
            for record in records:
                print(record)
if __name__ == "__main__":
    getFirstLimitUpPremium("2023-12-26")
utils/buy_condition_util.py
New file
@@ -0,0 +1,13 @@
"""
买入条件工具
"""
# 获取自由流通市值限制
# 返回:(最大买入,最优自由流通最小,最优自由流通最大)
from trade.trade_manager import MarketSituationManager
def get_zyltgb_threshold(market_sitation: int):
    if market_sitation == MarketSituationManager.SITUATION_GOOD:
        return 100 * 100000000, 20 * 100000000, 60 * 100000000
    return 40 * 100000000, 10 * 100000000, 20 * 100000000