| | |
| | | index_trend_expectation_score = index_trend_expectation() |
| | | logger.info(f"大盘指数情绪预期分数==={index_trend_expectation_score}分") |
| | | print(f"大盘指数情绪预期分数==={index_trend_expectation_score}分") |
| | | # 目前大盘指数情绪预期分数 尚不科学 强制设置为初始0值 |
| | | index_trend_expectation_score = 0 |
| | | |
| | | # 获取计算今天新增的持仓数量 |
| | | addition_position_number = len(data_cache.addition_position_symbols_set) |
| | | # 定义一个今日的剩余新增持仓数量的变量 |
| | | Unfinished_opening_plan_number = 3 - addition_position_number |
| | | if Unfinished_opening_plan_number != 0: |
| | | # 如果GUI看盘上没有手动设置具体的下单金额,就按照评分策略的金额下单,否则就按照GUI设置的金额下单。 |
| | | if data_cache.BUY_MONEY_PER_CODE < 0: |
| | | # 根据账户可用金额 计算今日计划下单金额 |
| | | # (账户可用金额/今日最大新增持仓票数) * (大盘综合强度分数 * 0.01) |
| | | data_cache.today_planned_order_amount = (usefulMoney * index_trend_expectation_score / Unfinished_opening_plan_number) * (data_cache.real_time_market_strong * 0.01) |
| | | # ((大盘综合强度分数 + 大盘指数情绪预期分数) * 0.01) * (账户可用金额 * 极端低迷情绪比例 / 今日最大新增持仓票数) |
| | | data_cache.today_planned_order_amount = ((data_cache.real_time_market_strong + index_trend_expectation_score) * 0.01) * (usefulMoney * low_emotion_mood_ratio / Unfinished_opening_plan_number) |
| | | else: |
| | | data_cache.today_planned_order_amount = data_cache.BUY_MONEY_PER_CODE |
| | | |
| | | except Exception as error: |
| | | logger.error(f"获取实时大盘行情情绪综合强度[分数] 函数报错: {error}") |
| | |
| | | |
| | | |
| | | # kpl_stocks_list_selected_blocks_process() #在 kpl_api.py中可以调用 |
| | | |
| | | # stocks_list_selected_blocks(min_stocks) #在 kpl_api.py中可以调用 |
| | | |
| | | # list = ['SHSE.600805','SHSE.600804'] |
| | | # |
| | | # all_stocks_plate_dict(list) |