| | |
| | | "buy_first_limit_up": 1 if constant.CAN_BUY_FIRST_LIMIT_UP else 0, |
| | | "can_auto_add_white": 1 if constant.CAN_AUTO_ADD_WHITE else 0, |
| | | "can_auto_add_want_buy_codes": 1 if constant.CAN_AUTO_ADD_WANT_BUY_CODES else 0, |
| | | "can_auto_l_down_rate_change": 1 if constant.CAN_AUTO_L_DOWN_RATE_CHANGE else 0 |
| | | "can_auto_l_down_rate_change": 1 if constant.CAN_AUTO_L_DOWN_RATE_CHANGE else 0, |
| | | "auto_add_want_buy_codes_time_ranges": constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES |
| | | }} |
| | | self.send_response({"code": 0, "data": data, "msg": f""}, |
| | | client_id, |
| | |
| | | constant.CAN_AUTO_L_DOWN_RATE_CHANGE = True if radical_buy.get( |
| | | 'can_auto_l_down_rate_change') else False |
| | | |
| | | if radical_buy.get('auto_add_want_buy_codes_time_ranges') is not None: |
| | | time_ranges = radical_buy.get('auto_add_want_buy_codes_time_ranges') |
| | | constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES = (time_ranges.split(",")[0], time_ranges.split(",")[1]) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | self.send_response({"code": 0, "data": {}, "msg": f""}, |
| | |
| | | # L后撤单比例自动变化 |
| | | CAN_AUTO_L_DOWN_RATE_CHANGE = True |
| | | |
| | | |
| | | # 自动加想时段 |
| | | AUTO_ADD_WANT_BUY_CODES_TIME_RANGES = ("09:25:00", "10:00:00") |
| | |
| | | l2_log.info(code, logger_l2_radical_buy, f"即将炸板:{code}-{is_almost_open_limit_up}-{l2_market_time_str}") |
| | | deal_codes = RadicalBuyDealCodesManager().get_deal_codes() |
| | | # 判断今日扫入的代码数量是否大于阈值 |
| | | radical_buy_setting = BuyMoneyAndCountSetting().get_radical_buy_setting() |
| | | MAX_COUNT = 4 if radical_buy_setting is None else radical_buy_setting[0] |
| | | if not WantBuyCodesManager().is_in_cache(code): |
| | | # 加绿不判断板块是否成交 |
| | | if len(deal_codes) >= MAX_COUNT: |
| | | l2_log.info(code, logger_l2_radical_buy, f"扫入成交代码个数大于{MAX_COUNT}个:{code}-{deal_codes}") |
| | | return True |
| | | # radical_buy_setting = BuyMoneyAndCountSetting().get_radical_buy_setting() |
| | | # MAX_COUNT = 4 if radical_buy_setting is None else radical_buy_setting[0] |
| | | # if not WantBuyCodesManager().is_in_cache(code): |
| | | # # 加绿不判断板块是否成交 |
| | | # if len(deal_codes) >= MAX_COUNT: |
| | | # l2_log.info(code, logger_l2_radical_buy, f"扫入成交代码个数大于{MAX_COUNT}个:{code}-{deal_codes}") |
| | | # return True |
| | | if code in deal_codes and not CodesContinueBuyMoneyManager().get_continue_buy_money(code): |
| | | l2_log.info(code, logger_l2_radical_buy, f"该代码已经成交:{code}") |
| | | return True |
| | |
| | | |
| | | # -----根据成交比例判断是否可买------ |
| | | if not is_last_sell_deal: |
| | | result_by_volume = radical_buy_strategy.process_limit_up_active_buy_deal(code, transaction_datas, |
| | | is_almost_open_limit_up, |
| | | no_left_limit_up_sell=no_left_limit_up_sell) |
| | | result_by_volume = radical_buy_strategy.process_limit_up_active_buy_deal(code, |
| | | transaction_datas, |
| | | is_almost_open_limit_up, |
| | | no_left_limit_up_sell=no_left_limit_up_sell) |
| | | else: |
| | | result_by_volume = radical_buy_strategy.BUY_MODE_BY_L2, f"最后一笔涨停卖成交" |
| | | l2_log.info(code, logger_l2_radical_buy, f"量买入结果判断:{code}, 结果:{result_by_volume} 板块:{buy_blocks}") |
| | |
| | | 执行自动加想策略 |
| | | @return: |
| | | """ |
| | | if tool.get_now_time_str() > '13:00:00': |
| | | # 下午不自动加想 |
| | | if constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES[0] < tool.get_now_time_str() < constant.AUTO_ADD_WANT_BUY_CODES_TIME_RANGES[1]: |
| | | pass |
| | | else: |
| | | # 不在加想时段内 |
| | | return |
| | | codes = LimitUpDataConstant.get_history_limit_up_codes() |
| | | if not codes: |
| | |
| | | continue |
| | | limit_up_price = gpcode_manager.get_limit_up_price_as_num(code) |
| | | # 只加首板 |
| | | if not limit_up_price or limit_up_price < 3 or limit_up_price > 100: |
| | | if not limit_up_price or limit_up_price < 3 or limit_up_price > 300: |
| | | continue |
| | | if code in yesterday_codes: |
| | | continue |
| | |
| | | # 上一个50W的起始时间:{code:"09:30:00.120"} |
| | | import time |
| | | |
| | | from cancel_strategy.s_l_h_cancel_strategy import CancelRateHumanSettingManager |
| | | from code_attribute import code_volumn_manager, gpcode_manager |
| | | from l2.code_price_manager import Buy1PriceManager |
| | | from l2.huaxin import l2_huaxin_util |
| | |
| | | huaxin_timestamp = transaction_datas[-1][3] |
| | | |
| | | # 判断是否可以扫入, 暂时都不可扫入 |
| | | can_direct_buy = False |
| | | |
| | | # human_setting_money = TotalDealBigOrderThresholdMoneyManager().get_money_cache(code) |
| | | # if human_setting_money: |
| | | # # 自由市值80亿以上不扫 |
| | |
| | | if refer_sell_data: |
| | | refer_sell_money = refer_sell_data[1] |
| | | |
| | | if refer_sell_money < 500e4: |
| | | # 参考抛压小于500万,直接根据L2下单 |
| | | return BUY_MODE_BY_L2, f"总抛压小于500w({refer_sell_money})" |
| | | |
| | | # 处于涨停卖的委托订单总手数 |
| | | selling_num = L2LimitUpSellDataManager.get_delegating_sell_num(code) |
| | | if selling_num is None: |
| | |
| | | # 剩余涨停卖金额 |
| | | left_limit_up_sell_money = selling_num * price |
| | | |
| | | # 判断总抛压是否已经消耗掉了80% |
| | | human_rate = CancelRateHumanSettingManager().get_l_down(code) |
| | | if human_rate and refer_sell_money > 0 and human_rate >= 1.00: |
| | | limit_up_sell_deal_rate = (refer_sell_money - left_limit_up_sell_money) / refer_sell_money |
| | | if limit_up_sell_deal_rate >= 0.8: |
| | | # 撤单率设置为100%以上的,如果总抛压消耗掉80%就下单 |
| | | return BUY_MODE_DIRECT, f"L后人为撤单比例({human_rate})>=100%, 总抛压-{refer_sell_money}, 剩余没吃-{left_limit_up_sell_money}" |
| | | can_direct_buy = False |
| | | if refer_sell_money < 500e4: |
| | | # 参考抛压小于500万,直接根据L2下单 |
| | | return BUY_MODE_BY_L2, f"总抛压小于500w({refer_sell_money})" |
| | | |
| | | # 每次上板的大单与金额 |
| | | big_order_count = radical_buy_data_manager.EveryLimitupBigDealOrderManager.get_big_buy_deal_order_count(code) |
| | | big_order_money = radical_buy_data_manager.EveryLimitupBigDealOrderManager.get_big_buy_deal_order_money(code) |