1.精选流入09:25起开始进入数据
2.修复日志数据的None BUG
3.分离出手动拉黑后的决策日志和手动拉黑前的决策日志
| | |
| | | def get_market_sift_plate_its_stock_power_process(market_sift_plate_info): |
| | | # print(f"回调成功===精选板块股票强度数据更新==={market_sift_plate_stock_dict}") |
| | | # logger_kpl_jingxuan_in.info(f"{market_sift_plate_stock_dict}") |
| | | if market_sift_plate_info is not None: |
| | | return |
| | | market_sift_plate_stock_dict, market_sift_plates = market_sift_plate_info[0], market_sift_plate_info[1] |
| | | if market_sift_plate_stock_dict: |
| | | data_cache.market_sift_plate_stock_dict = market_sift_plate_stock_dict |
| | |
| | | ''' |
| | | 有概念视界 |
| | | ''' |
| | | if len(limit_up_plate_included) != 0 and limit_up_plate_included.issubset( |
| | | check_plate_list) is False: |
| | | if len(limit_up_plate_included) != 0 and limit_up_plate_included.issubset(constant.check_plate_list) is False: |
| | | logger_info( |
| | | f"【{k_line_data[0]['sec_name']}】--------------------------------------------------------------------------------------------------------[有概念视界]") |
| | | logger_info(f"包含涨停概念:{limit_up_plate_included}") |
| | |
| | | f"最新价: {current_price}, 当日最高价:{current_high},瞬时涨幅: {tick_growth:.2f}%,瞬时量幅比:{last_volume_to_growth_ratio:.2f}%,当日当时涨幅:{today_growth}%,公司名称:{k_line_data[0]['sec_name']},当前时间:{current_created_at},低于水位线:{deep_low:.2f},交易量今日与昨日的比例{round(current_volume / k_line_data[0]['volume'], 2)}") |
| | | logger_info( |
| | | f"大盘综合强度分数:{data_cache.real_time_market_strong},理想交易行情分数==={data_cache.ideal_trading_market_score}分,设想的下单金额:{get_order_money()}") |
| | | # 调用下单方法下单 |
| | | order_methods.buy_order_by_value(symbol, |
| | | get_order_money(), |
| | | k_line_data[0]['sec_name'], |
| | | current_price) |
| | | |
| | | # 传给GUI显示 |
| | | purchased_stock_details = { |
| | | "name": k_line_data[0]['sec_name'], |
| | |
| | | "buy_time_trading_volume_ratio": ( |
| | | current_volume / k_line_data[0]['volume']), |
| | | } |
| | | # 如果个股的所属概念板块在GUI手动添加后的拉黑版块里则不跳出不下单 |
| | | if limit_up_plate_included.issubset(check_plate_list) is True: |
| | | logger_info( |
| | | f"【不利】有概念板块在GUI手动添加后的拉黑板块里!不买了!!公司名称:{k_line_data[0]['sec_name']},GUI手动添加后的拉黑板块=={check_plate_list}") |
| | | return |
| | | # 调用下单方法下单 |
| | | order_methods.buy_order_by_value(symbol, |
| | | get_order_money(), |
| | | k_line_data[0]['sec_name'], |
| | | current_price) |
| | | data_cache.purchased_stocks_details_list.append(purchased_stock_details) |
| | | |
| | | logger_info(f"已成交股票详情列表:{data_cache.purchased_stocks_details_list} ") |
| | | # 检测持仓代码集合中有无下单个股,才认为交易成功 |
| | | if symbol_code not in data_cache.position_symbols_set: |
| | |
| | | ''' |
| | | if k_line_data[0]['attribute'] in data_cache.limit_up_type: |
| | | # logger_info(f"昨日涨停") |
| | | if k_line_data[1]['attribute'] not in data_cache.limit_up_type and k_line_data[2][ |
| | | 'attribute'] not in data_cache.limit_up_type: |
| | | if k_line_data[1]['attribute'] not in data_cache.limit_up_type and k_line_data[2]['attribute'] not in data_cache.limit_up_type: |
| | | # logger_info(f"前日大前日未涨停") |
| | | if today_open_growth > 1: |
| | | logger_info( |
| | |
| | | logger_info(f"昨日首板涨停,当日中等以上高开 {today_open_growth}% !") |
| | | if limit_up_day > 6 and any( |
| | | 'attribute' in d and d['attribute'] in data_cache.limit_up_type for |
| | | d in k_line_data[1:3]) and current_volume <= k_line_data[0][ |
| | | 'volume'] * 1.5: |
| | | d in k_line_data[1:3]) and current_volume <= k_line_data[0]['volume'] * 1.5: |
| | | logger_info( |
| | | f"【不利】过于显著票 且 前日或上前日涨停板 当日量还不足昨日量的1.5倍!不买!! 今日当时成交量为昨日等比量的{round(current_volume / k_line_data[0]['volume'], 2)}倍,90天内涨停天数:{limit_up_day}") |
| | | elif len(TodayBuyCodeManager().get_buy_codes()) >= 3: |
| | |
| | | # print(f"market_sift_plate 数 ======{len(market_sift_plate['list'])}") |
| | | |
| | | # 精选板块【前20】 market_sift_plate['list'] ====== |
| | | if data_cache.OPENING_TIME < now_time < data_cache.AFTER_CLOSING_TIME: |
| | | if data_cache.OPEN_BIDDING_TIME < now_time < data_cache.AFTER_CLOSING_TIME: |
| | | logger_kpl_market_sift_plate.info(f"{market_sift_plate['list']}") |
| | | # 总控制时间段 |
| | | if not (data_cache.OPENING_TIME < now_time < data_cache.NOON_MARKET_TIME): |
| | | if not (data_cache.OPEN_BIDDING_TIME < now_time < data_cache.NOON_MARKET_TIME): |
| | | return |
| | | # ['801235', '化工', 6996, 0.027, 2.43, 117836347690, -122548038, 8105997595, -8228545633, 0.92, 8595377775454, 0.09, 332297449, 9954902621130, -192457252, 24.0487, 17.1809, 6996, 0.027] |
| | | # market_sift_plate['list'][0] = ['801062', '军工', 3520, -0.49, 0.666, 139133934669, 383864272, 9077352839, -8693488567, 1.183, 6129448037490,-0.12, 168245858, 7088854452019, -290614763, 50.2408, 30.3672, 3520, 0] |