| | |
| | | order_methods.buy_order_by_value(symbol, data_cache.today_planned_order_amount, |
| | | k_line_data[0]['sec_name'], |
| | | current_price) |
| | | # 将有概念买入次数自加1 |
| | | data_cache.have_plate_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(limit_up_plate_included_list) |
| | | # 查看一下该股有无大单 |
| | | L2_data_analysis.find_L2_big_order_of_code(symbol_code) |
| | | # 检测持仓信息中有无下单个股且有该个股的当前持仓,只有当前持仓数量不为0时,才认为交易成功 |
| | | for i in data_cache.account_positions_dict: |
| | | # print(i) |
| | | if i['securityID'] == symbol_code: |
| | | # print(i['currentPosition']) |
| | | if i['currentPosition'] == 0: |
| | | logger.info(f"【{i['securityName']}】交易失败~") |
| | | else: |
| | | # 将有概念买入次数自加1 |
| | | data_cache.have_plate_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(limit_up_plate_included_list) |
| | | logger.info(f"【{i['securityName']}】交易成功!") |
| | | |
| | | |
| | | |
| | | # 有概念无强度视界 |
| | |
| | | # order_methods.buy_order_by_value(symbol, 1000, |
| | | # k_line_data[0]['sec_name'], |
| | | # current_price) |
| | | # 将有概念买入次数自加1 |
| | | data_cache.have_plate_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(limit_up_plate_included_list) |
| | | # 查看一下该股有无大单 |
| | | # # 将有概念买入次数自加1 |
| | | # data_cache.have_plate_buy_times += 1 |
| | | # # 将买入个股的当时概念添加到全局变量中存储 |
| | | # data_cache.bought_plate.extend(limit_up_plate_included_list) |
| | | # # 查看一下该股有无大单 |
| | | L2_data_analysis.find_L2_big_order_of_code(symbol_code) |
| | | # 检测持仓信息中有无下单个股且有该个股的当前持仓,只有当前持仓数量不为0时,才认为交易成功 |
| | | for i in data_cache.account_positions_dict: |
| | | # print(i) |
| | | if i['securityID'] == symbol_code: |
| | | # print(i['currentPosition']) |
| | | if i['currentPosition'] == 0: |
| | | logger.info(f"【{i['securityName']}】交易失败~") |
| | | else: |
| | | # 将有概念买入次数自加1 |
| | | data_cache.have_plate_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(limit_up_plate_included_list) |
| | | logger.info(f"【{i['securityName']}】交易成功!") |
| | | |
| | | ''' |
| | | 无概念 有强度视界 |
| | |
| | | data_cache.today_planned_order_amount, |
| | | k_line_data[0]['sec_name'], |
| | | current_price) |
| | | # 将有强度买入次数自加1 |
| | | data_cache.have_strength_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(strength_plate) |
| | | # # 将有强度买入次数自加1 |
| | | # data_cache.have_strength_buy_times += 1 |
| | | # # 将买入个股的当时概念添加到全局变量中存储 |
| | | # data_cache.bought_plate.extend(strength_plate) |
| | | # 查看一下该股有无大单 |
| | | L2_data_analysis.find_L2_big_order_of_code(symbol_code) |
| | | # 检测持仓信息中有无下单个股且有该个股的当前持仓,只有当前持仓数量不为0时,才认为交易成功 |
| | | for i in data_cache.account_positions_dict: |
| | | # print(i) |
| | | if i['securityID'] == symbol_code: |
| | | # print(i['currentPosition']) |
| | | if i['currentPosition'] == 0: |
| | | logger.info(f"【{i['securityName']}】交易失败~") |
| | | else: |
| | | # 将有概念买入次数自加1 |
| | | data_cache.have_strength_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(strength_plate) |
| | | logger.info(f"【{i['securityName']}】交易成功!") |
| | | ''' |
| | | 无概念无强度 有小量换大涨幅度视界 |
| | | ''' |
| | |
| | | order_methods.buy_order_by_value(symbol, 1000, |
| | | k_line_data[0]['sec_name'], |
| | | current_price) |
| | | # 将有小量换大涨幅买入次数自加1 |
| | | data_cache.have_small_turn_large_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.append(k_line_data[0]['sec_name']) |
| | | # # 将有小量换大涨幅买入次数自加1 |
| | | # data_cache.have_small_turn_large_buy_times += 1 |
| | | # # 将买入个股的当时概念添加到全局变量中存储 |
| | | # data_cache.bought_plate.append(k_line_data[0]['sec_name']) |
| | | # 查看一下该股有无大单 |
| | | L2_data_analysis.find_L2_big_order_of_code(symbol_code) |
| | | # 检测持仓信息中有无下单个股且有该个股的当前持仓,只有当前持仓数量不为0时,才认为交易成功 |
| | | for i in data_cache.account_positions_dict: |
| | | # print(i) |
| | | if i['securityID'] == symbol_code: |
| | | # print(i['currentPosition']) |
| | | if i['currentPosition'] == 0: |
| | | logger.info(f"【{i['securityName']}】交易失败~") |
| | | else: |
| | | # 将有概念买入次数自加1 |
| | | data_cache.have_small_turn_large_buy_times += 1 |
| | | # 将买入个股的当时概念添加到全局变量中存储 |
| | | data_cache.bought_plate.extend(k_line_data[0]['sec_name']) |
| | | logger.info(f"【{i['securityName']}】交易成功!") |
| | | ''' |
| | | 昨日涨停视界,今日连板预期盯视界 |
| | | ''' |
| | |
| | | # 如果K线数据为空,则不进入后续判断 |
| | | # print(f"代码:{symbol},k_line_data is None,未get到该股的K线属性,或为新股、次新股第一天的时候确实没有历史K线") |
| | | |
| | | |
| | | # 委托状态更新事件 |
| | | def on_order_status(context, order): |
| | | # 可在后面执行其他处理逻辑 |
| | | logger.info(f"买入策略context====t————{context}") |
| | | logger.info(f"买入策略order====t————{order}") |
| | | |
| | | |
| | | # 委托执行回报事件 |
| | | def on_execution_report(context, execrpt): |
| | | logger.info(f"买入策略context===={context}") |
| | | logger.info(f"execrpt========{execrpt}") |