main
parent
0534d6abc2
commit
6833059711
@ -1,321 +0,0 @@ |
|||||||
# -*- coding: utf-8 -*- |
|
||||||
import os |
|
||||||
import random |
|
||||||
import sys |
|
||||||
import openai |
|
||||||
import httpx |
|
||||||
import csv |
|
||||||
from datetime import datetime |
|
||||||
import jieba |
|
||||||
import time |
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.abspath(__file__).split('AlphaGenerator')[0] + 'AlphaGenerator')) |
|
||||||
PROJECT_PATH = os.path.join(os.path.abspath(__file__).split('AlphaGenerator')[0] + 'AlphaGenerator') |
|
||||||
|
|
||||||
PREPARE_PROMPT = os.path.join(PROJECT_PATH, 'prepare_prompt') |
|
||||||
KEYS_TEXT = os.path.join(PREPARE_PROMPT, 'keys_text.txt') |
|
||||||
|
|
||||||
TEMPERATURE = 0.1 |
|
||||||
|
|
||||||
USE_AI = 0 |
|
||||||
|
|
||||||
SILICONFLOW_API_KEY = "sk-pvdiisdowmuwkrpnxsrlhxaovicqibmlljwrwwvbbdjaitdl" |
|
||||||
SILICONFLOW_BASE_URL = "https://api.siliconflow.cn/v1" |
|
||||||
MODELS = [ |
|
||||||
'Pro/deepseek-ai/DeepSeek-V3.1-Terminus', |
|
||||||
'deepseek-ai/DeepSeek-V3.2-Exp', |
|
||||||
'Qwen/Qwen3-VL-235B-A22B-Instruct', |
|
||||||
# 'MiniMaxAI/MiniMax-M2', |
|
||||||
# 'zai-org/GLM-4.6', |
|
||||||
# 'inclusionAI/Ring-flash-2.0', |
|
||||||
# 'zai-org/GLM-4.6', |
|
||||||
# 'inclusionAI/Ling-flash-2.0', |
|
||||||
# 'inclusionAI/Ring-flash-2.0', |
|
||||||
] |
|
||||||
|
|
||||||
|
|
||||||
def process_text(text): |
|
||||||
filter_list = ['\n', '\t', '\r', '\b', '\f', '\v', ':', '的', '或', '10', '天', '了', '可', '是', '该', ',', ' ', '、', '让', '和', '集', |
|
||||||
'/', '日', '在', '(', '_', '-', ')', '(', '上', '距', '与', '比', '下', '及', ')', '...', ';', '%', '&', '+', ',', '.', |
|
||||||
':', ';', '<', '=', '>', '?', '[', ']', '|', '—', '。' |
|
||||||
] |
|
||||||
|
|
||||||
text_list = jieba.lcut(text) |
|
||||||
results = [] |
|
||||||
for tl in text_list: |
|
||||||
should_include = True |
|
||||||
for fl in filter_list: |
|
||||||
if fl == tl: |
|
||||||
should_include = False |
|
||||||
break |
|
||||||
if should_include: |
|
||||||
results.append(tl.lower()) |
|
||||||
|
|
||||||
results = [item for item in results if item != '"' and len(item) > 2] |
|
||||||
|
|
||||||
if results: |
|
||||||
return list(set(results)) |
|
||||||
else: |
|
||||||
return None |
|
||||||
|
|
||||||
|
|
||||||
def load_keys_text(): |
|
||||||
if not os.path.exists(KEYS_TEXT): |
|
||||||
print(f"文件不存在: {KEYS_TEXT}") |
|
||||||
exit(1) |
|
||||||
with open(KEYS_TEXT, 'r', encoding='utf-8') as f: |
|
||||||
text_list = [line.strip() for line in f if line.strip()] |
|
||||||
if not text_list: |
|
||||||
print('关键词文本无数据, 程序退出') |
|
||||||
exit(1) |
|
||||||
|
|
||||||
result_str = process_text(';'.join(text_list)) |
|
||||||
|
|
||||||
print(f'\n关键词文本处理结果: {result_str}\n') |
|
||||||
|
|
||||||
return result_str |
|
||||||
|
|
||||||
|
|
||||||
def txtFileLoader(file_path): |
|
||||||
if not os.path.exists(file_path): |
|
||||||
print(f"文件不存在: {file_path}") |
|
||||||
exit(1) |
|
||||||
with open(file_path, 'r', encoding='utf-8') as f: |
|
||||||
return [line.strip() for line in f if line.strip()] |
|
||||||
|
|
||||||
|
|
||||||
def csvFileLoader(file_path, keys_text): |
|
||||||
if not os.path.exists(file_path): |
|
||||||
print(f"文件不存在: {file_path}") |
|
||||||
exit(1) |
|
||||||
|
|
||||||
data_dict = {} # 使用字典来存储,以id为键 |
|
||||||
|
|
||||||
with open(file_path, 'r', encoding='utf-8') as f: |
|
||||||
reader = csv.reader(f) |
|
||||||
for row in reader: |
|
||||||
for key in keys_text: |
|
||||||
if key in row[11] or key in row[12]: |
|
||||||
item_id = row[0] |
|
||||||
# 如果id不存在,或者想要保留第一个出现的记录 |
|
||||||
if item_id not in data_dict: |
|
||||||
data_dict[item_id] = { |
|
||||||
'data_set_name': f"可以使用:{row[1]}", |
|
||||||
'description': f"不可使用,仅供参考:{row[2]}", |
|
||||||
# 'description_cn': row[11], |
|
||||||
} |
|
||||||
|
|
||||||
# 将字典的值转换为列表 |
|
||||||
return list(data_dict.values()) |
|
||||||
|
|
||||||
|
|
||||||
def read_prompt(alpha_prompt_path): |
|
||||||
if not os.path.exists(alpha_prompt_path): |
|
||||||
print("alpha_prompt.txt文件不存在") |
|
||||||
exit(1) |
|
||||||
with open(alpha_prompt_path, 'r', encoding='utf-8') as f: |
|
||||||
prompt = f.read().strip() |
|
||||||
if not prompt: |
|
||||||
print("alpha_prompt.txt是空的") |
|
||||||
exit(1) |
|
||||||
return prompt.replace('\n\n', '\n') |
|
||||||
|
|
||||||
|
|
||||||
def read_operator(operator_prompt_path): |
|
||||||
if not os.path.exists(operator_prompt_path): |
|
||||||
print("wqb_operator.txt文件不存在") |
|
||||||
exit(1) |
|
||||||
with open(operator_prompt_path, 'r', encoding='utf-8') as f: |
|
||||||
operator_lines = [line.strip() for line in f.readlines() if line.strip()] |
|
||||||
if not operator_lines: |
|
||||||
print("wqb_operator.txt是空的") |
|
||||||
exit(1) |
|
||||||
return "\n".join(operator_lines) |
|
||||||
|
|
||||||
|
|
||||||
def create_result_folder(): |
|
||||||
folder_name = "generated_alpha" |
|
||||||
if not os.path.exists(folder_name): |
|
||||||
os.makedirs(folder_name) |
|
||||||
|
|
||||||
now = datetime.now() |
|
||||||
year_folder = os.path.join(folder_name, str(now.year)) |
|
||||||
month_folder = os.path.join(year_folder, f"{now.month:02d}") |
|
||||||
day_folder = os.path.join(month_folder, f"{now.day:02d}") |
|
||||||
|
|
||||||
if not os.path.exists(year_folder): |
|
||||||
os.makedirs(year_folder) |
|
||||||
if not os.path.exists(month_folder): |
|
||||||
os.makedirs(month_folder) |
|
||||||
if not os.path.exists(day_folder): |
|
||||||
os.makedirs(day_folder) |
|
||||||
|
|
||||||
return day_folder |
|
||||||
|
|
||||||
|
|
||||||
def call_siliconflow(prompt, model): |
|
||||||
try: |
|
||||||
client = openai.OpenAI( |
|
||||||
api_key=SILICONFLOW_API_KEY, |
|
||||||
base_url=SILICONFLOW_BASE_URL |
|
||||||
) |
|
||||||
|
|
||||||
response = client.chat.completions.create( |
|
||||||
model=model, |
|
||||||
messages=[ |
|
||||||
{"role": "system", "content": "你是一个专业的量化投资专家,擅长编写Alpha因子。"}, |
|
||||||
{"role": "user", "content": prompt} |
|
||||||
], |
|
||||||
temperature=TEMPERATURE |
|
||||||
) |
|
||||||
|
|
||||||
return response.choices[0].message.content |
|
||||||
|
|
||||||
except openai.AuthenticationError: |
|
||||||
print("API密钥错误") |
|
||||||
except openai.RateLimitError: |
|
||||||
print("调用频率限制") |
|
||||||
except openai.APIError as e: |
|
||||||
print(f"API错误: {e}") |
|
||||||
except Exception as e: |
|
||||||
print(f"其他错误: {e}") |
|
||||||
exit(1) |
|
||||||
|
|
||||||
|
|
||||||
def save_result(result, folder, model_name): |
|
||||||
now = datetime.now() |
|
||||||
time_filename = now.strftime("%H%M%S") |
|
||||||
|
|
||||||
filename = f"{model_name}_{time_filename}.txt" |
|
||||||
filepath = os.path.join(folder, filename) |
|
||||||
|
|
||||||
with open(filepath, 'w', encoding='utf-8') as f: |
|
||||||
f.write(result) |
|
||||||
|
|
||||||
print(f"结果保存到: {filepath}") |
|
||||||
|
|
||||||
|
|
||||||
def get_user_info(): |
|
||||||
headers = {"Authorization": f"Bearer {SILICONFLOW_API_KEY}"} |
|
||||||
url = "https://api.siliconflow.cn/v1/user/info" |
|
||||||
response = httpx.get(url, headers=headers) |
|
||||||
data = response.json()['data'] |
|
||||||
balance = data['totalBalance'] |
|
||||||
print(f"余额: {balance}") |
|
||||||
return float(balance) |
|
||||||
|
|
||||||
|
|
||||||
def manual_prompt(prompt): |
|
||||||
manual_prompt_path = os.path.join(PROJECT_PATH, "manual_prompt") |
|
||||||
|
|
||||||
if not os.path.exists(manual_prompt_path): |
|
||||||
os.makedirs(manual_prompt_path) |
|
||||||
|
|
||||||
now = datetime.now() |
|
||||||
year_folder = os.path.join(manual_prompt_path, str(now.year)) |
|
||||||
month_folder = os.path.join(year_folder, f"{now.month:02d}") |
|
||||||
day_folder = os.path.join(month_folder, f"{now.day:02d}") |
|
||||||
|
|
||||||
if not os.path.exists(year_folder): |
|
||||||
os.makedirs(year_folder) |
|
||||||
if not os.path.exists(month_folder): |
|
||||||
os.makedirs(month_folder) |
|
||||||
if not os.path.exists(day_folder): |
|
||||||
os.makedirs(day_folder) |
|
||||||
|
|
||||||
# 文件名后添加保存时间 |
|
||||||
filename = f"manual_prompt_{now.strftime('%Y%m%d%H%M%S')}.txt" |
|
||||||
filepath = os.path.join(day_folder, filename) |
|
||||||
|
|
||||||
with open(filepath, 'w', encoding='utf-8') as f: |
|
||||||
f.write(prompt) |
|
||||||
|
|
||||||
print(f"手动提示词保存到: {filepath}") |
|
||||||
|
|
||||||
|
|
||||||
def call_ai(prompt, model): |
|
||||||
balance = get_user_info() |
|
||||||
|
|
||||||
folder = create_result_folder() |
|
||||||
|
|
||||||
print(f"正在调用AI...{model}") |
|
||||||
result = call_siliconflow(prompt, model) |
|
||||||
|
|
||||||
if result: |
|
||||||
print(f"AI回复: {result[:200]}...") |
|
||||||
model_name = model.replace("/", "_") |
|
||||||
save_result(result, folder, model_name) |
|
||||||
used_balance = balance - get_user_info() |
|
||||||
print(f'本次调用 api 使用额度 {used_balance}') |
|
||||||
else: |
|
||||||
print("AI调用失败") |
|
||||||
|
|
||||||
|
|
||||||
def prepare_prompt(data_sets): |
|
||||||
prompt = '' |
|
||||||
|
|
||||||
# 读取基础提示词 |
|
||||||
alpha_prompt_path = os.path.join(PREPARE_PROMPT, "alpha_prompt.txt") |
|
||||||
prompt += read_prompt(alpha_prompt_path) |
|
||||||
|
|
||||||
# 读取操作符 |
|
||||||
prompt += "\n\n以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子\n\n" |
|
||||||
prompt += "========================= 操作符开始 =======================================\n" |
|
||||||
prompt += "注意: Operator: 后面的是操作符(是可以使用的),\nDescription: 此字段后面的是操作符对应的描述或使用说明(禁止使用, 仅供参考), Description字段后面的内容是使用说明, 不是操作符\n" |
|
||||||
prompt += "特别注意!!!! 必须按照操作符字段Operator的使用说明生成 alpha" |
|
||||||
operator_prompt_path = os.path.join(PREPARE_PROMPT, "operator.txt") |
|
||||||
operator = read_operator(operator_prompt_path) |
|
||||||
prompt += operator |
|
||||||
prompt += "\n========================= 操作符结束 =======================================\n\n" |
|
||||||
|
|
||||||
prompt += "========================= 数据字段开始 =======================================\n" |
|
||||||
prompt += "注意: data_set_name: 后面的是数据字段(可以使用), description: 此字段后面的是数据字段对应的描述或使用说明(不能使用), description_cn字段后面的内容是中文使用说明(不能使用)\n\n" |
|
||||||
for data_set in data_sets: |
|
||||||
prompt += str(data_set) + '\n' |
|
||||||
|
|
||||||
prompt += "========================= 数据字段结束 =======================================\n\n" |
|
||||||
|
|
||||||
prompt += "以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合" |
|
||||||
|
|
||||||
return prompt |
|
||||||
|
|
||||||
|
|
||||||
def main(): |
|
||||||
# 将金融逻辑, 分割成标签 |
|
||||||
keys_text = load_keys_text() |
|
||||||
|
|
||||||
# 分割好的标签, 搜索对应的数据集, 返回匹配到的结果 |
|
||||||
data_sets_path = os.path.join(PREPARE_PROMPT, "all_data_combined.csv") |
|
||||||
result_data_sets = csvFileLoader(data_sets_path, keys_text) |
|
||||||
|
|
||||||
if not result_data_sets: |
|
||||||
print(f'搜索数据集为空, 程序退出') |
|
||||||
exit(1) |
|
||||||
|
|
||||||
data_sets = 0 |
|
||||||
print(f'从数据集中提取了 {len(result_data_sets)} 条数据') |
|
||||||
if len(result_data_sets) > 500: |
|
||||||
data_sets = random.sample(result_data_sets, 10) |
|
||||||
else: |
|
||||||
data_sets = result_data_sets |
|
||||||
|
|
||||||
# 组合提示词 |
|
||||||
prompt = prepare_prompt(data_sets) |
|
||||||
|
|
||||||
# # 如果需要手动在页面段模型, 使用提示词, 打开这个, 将生成的提示词存到本地 |
|
||||||
manual_prompt(prompt) |
|
||||||
|
|
||||||
if len(result_data_sets) <= 10: |
|
||||||
print(f'从数据集中提取了 {len(result_data_sets)} 条数据, 数量太少, 程序退出') |
|
||||||
exit(1) |
|
||||||
|
|
||||||
if USE_AI: |
|
||||||
for model in MODELS: |
|
||||||
# 如果需要使用模型, 打开这个 |
|
||||||
call_ai(prompt, model) |
|
||||||
|
|
||||||
time.sleep(5) |
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__": |
|
||||||
main() |
|
||||||
@ -0,0 +1,300 @@ |
|||||||
|
任务指令: 你需要根据以下这个金融逻辑, 组合创新 alpha |
||||||
|
数字化客户粘性溢价 |
||||||
|
假设 |
||||||
|
在数字经济时代,拥有高度数字化客户互动渠道和强大用户粘性的公司(如高频使用的移动应用、高活跃度的在线社区、高转化率的私域流量),能够以更低的边际成本获取更高质量的用户数据和现金流。这种数字化粘性构筑了强大的竞争护城河,其价值尚未被传统财务指标充分定价,有望在未来产生持续的超额收益。 |
||||||
|
实施方案 |
||||||
|
整合月活跃用户(MAU)增长率、用户日均使用时长、用户生命周期价值(LTV)与获客成本(CAC)的比率等数字化运营数据字段。使用时序动量算子(如ts_rank)对过去一年内“用户时长增长率”与“LTV/CAC比率”的综合得分进行排序。对排名持续提升且处于前30%的公司赋予正向阿尔法权重,并结合横截面标准化确保信号在同类商业模式公司(如消费互联网、金融科技)内进行比较。 |
||||||
|
阿尔法因子优化建议 |
||||||
|
数字化粘性的价值在不同增长阶段(导入期、成长期、成熟期)差异显著。建议引入“增长阶段分档”算子,根据用户规模增速和营收增速对公司进行动态分类,在各自的阶段组内计算粘性指标的相对强弱,以避免对处于不同生命周期公司的误判。此外,可叠加“变现效率变化”指标(如每用户平均收入(ARPU)的环比加速度),在粘性提升的同时,筛选出变现能力同步增强的标的,以增强信号的纯度。 |
||||||
|
*=========================================================================================* |
||||||
|
输出格式: |
||||||
|
输出必须是且仅是纯文本。 |
||||||
|
每一行是一个完整、独立、语法正确的WebSim表达式。 |
||||||
|
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。 |
||||||
|
===================== !!! 重点(输出方式) !!! ===================== |
||||||
|
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。 |
||||||
|
不要自行假设, 你需要用到的操作符 和 数据集, 必须从我提供给你的里面查找, 并严格按照里面的使用方法进行组合 |
||||||
|
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西): |
||||||
|
表达式 |
||||||
|
表达式 |
||||||
|
表达式 |
||||||
|
... |
||||||
|
表达式 |
||||||
|
================================================================= |
||||||
|
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。 |
||||||
|
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 30 个alpha: |
||||||
|
不要自行假设, 你需要用到的操作符 和 数据集, 必须从我提供给你的里面查找, 并严格按照里面的使用方法进行组合 |
||||||
|
================================================================= |
||||||
|
ts_product ts_zscore ts_mean ts_scale add sign subtract ts_delta ts_rank greater ts_av_diff ts_quantile ts_count_nans ts_covariance |
||||||
|
ts_arg_min divide ts_corr multiply if_else ts_sum ts_delay group_zscore ts_arg_max ts_std_de ts_backfill |
||||||
|
以上这些操作符不能传入事件类型的数据集, 只能传入时间序列数据集, 不能传入事件数据,不能传入事件数据,不能传入事件数据 |
||||||
|
|
||||||
|
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子 |
||||||
|
|
||||||
|
========================= 操作符开始 ======================================= |
||||||
|
注意: Operator: 后面的是操作符(是可以使用的), |
||||||
|
Description: 此字段后面的是操作符对应的描述或使用说明(禁止使用, 仅供参考), Description字段后面的内容是使用说明, 不是操作符 |
||||||
|
特别注意!!!! 必须按照操作符字段Operator的使用说明生成 alphaOperator: abs(x) |
||||||
|
Description: Absolute value of x |
||||||
|
Operator: add(x, y, filter = false) |
||||||
|
Description: Add all inputs (at least 2 inputs required). If filter = true, filter all input NaN to 0 before adding |
||||||
|
Operator: densify(x) |
||||||
|
Description: Converts a grouping field of many buckets into lesser number of only available buckets so as to make working with grouping fields computationally efficient |
||||||
|
Operator: divide(x, y) |
||||||
|
Description: x / y |
||||||
|
Operator: inverse(x) |
||||||
|
Description: 1 / x |
||||||
|
Operator: log(x) |
||||||
|
Description: Natural logarithm. For example: Log(high/low) uses natural logarithm of high/low ratio as stock weights. |
||||||
|
Operator: max(x, y, ..) |
||||||
|
Description: Maximum value of all inputs. At least 2 inputs are required |
||||||
|
Operator: min(x, y ..) |
||||||
|
Description: Minimum value of all inputs. At least 2 inputs are required |
||||||
|
Operator: multiply(x ,y, ... , filter=false) |
||||||
|
Description: Multiply all inputs. At least 2 inputs are required. Filter sets the NaN values to 1 |
||||||
|
Operator: power(x, y) |
||||||
|
Description: x ^ y |
||||||
|
Operator: reverse(x) |
||||||
|
Description: - x |
||||||
|
Operator: sign(x) |
||||||
|
Description: if input > 0, return 1; if input < 0, return -1; if input = 0, return 0; if input = NaN, return NaN; |
||||||
|
Operator: signed_power(x, y) |
||||||
|
Description: x raised to the power of y such that final result preserves sign of x |
||||||
|
Operator: sqrt(x) |
||||||
|
Description: Square root of x |
||||||
|
Operator: subtract(x, y, filter=false) |
||||||
|
Description: x-y. If filter = true, filter all input NaN to 0 before subtracting |
||||||
|
Operator: and(input1, input2) |
||||||
|
Description: Logical AND operator, returns true if both operands are true and returns false otherwise |
||||||
|
Operator: if_else(input1, input2, input 3) |
||||||
|
Description: If input1 is true then return input2 else return input3. |
||||||
|
Operator: input1 < input2 |
||||||
|
Description: If input1 < input2 return true, else return false |
||||||
|
Operator: input1 <= input2 |
||||||
|
Description: Returns true if input1 <= input2, return false otherwise |
||||||
|
Operator: input1 == input2 |
||||||
|
Description: Returns true if both inputs are same and returns false otherwise |
||||||
|
Operator: input1 > input2 |
||||||
|
Description: Logic comparison operators to compares two inputs |
||||||
|
Operator: input1 >= input2 |
||||||
|
Description: Returns true if input1 >= input2, return false otherwise |
||||||
|
Operator: input1!= input2 |
||||||
|
Description: Returns true if both inputs are NOT the same and returns false otherwise |
||||||
|
Operator: is_nan(input) |
||||||
|
Description: If (input == NaN) return 1 else return 0 |
||||||
|
Operator: not(x) |
||||||
|
Description: Returns the logical negation of x. If x is true (1), it returns false (0), and if input is false (0), it returns true (1). |
||||||
|
Operator: or(input1, input2) |
||||||
|
Description: Logical OR operator returns true if either or both inputs are true and returns false otherwise |
||||||
|
Operator: days_from_last_change(x) |
||||||
|
Description: Amount of days since last change of x |
||||||
|
Operator: hump(x, hump = 0.01) |
||||||
|
Description: Limits amount and magnitude of changes in input (thus reducing turnover) |
||||||
|
Operator: kth_element(x, d, k) |
||||||
|
Description: Returns K-th value of input by looking through lookback days. This operator can be used to backfill missing data if k=1 |
||||||
|
Operator: last_diff_value(x, d) |
||||||
|
Description: Returns last x value not equal to current x value from last d days |
||||||
|
Operator: ts_arg_max(x, d) |
||||||
|
Description: Returns the relative index of the max value in the time series for the past d days. If the current day has the max value for the past d days, it returns 0. If previous day has the max value for the past d days, it returns 1 |
||||||
|
Operator: ts_arg_min(x, d) |
||||||
|
Description: Returns the relative index of the min value in the time series for the past d days; If the current day has the min value for the past d days, it returns 0; If previous day has the min value for the past d days, it returns 1. |
||||||
|
Operator: ts_av_diff(x, d) |
||||||
|
Description: Returns x - tsmean(x, d), but deals with NaNs carefully. That is NaNs are ignored during mean computation |
||||||
|
Operator: ts_backfill(x,lookback = d, k=1, ignore="NAN") |
||||||
|
Description: Backfill is the process of replacing the NAN or 0 values by a meaningful value (i.e., a first non-NaN value) |
||||||
|
Operator: ts_corr(x, y, d) |
||||||
|
Description: Returns correlation of x and y for the past d days |
||||||
|
Operator: ts_count_nans(x ,d) |
||||||
|
Description: Returns the number of NaN values in x for the past d days |
||||||
|
Operator: ts_covariance(y, x, d) |
||||||
|
Description: Returns covariance of y and x for the past d days |
||||||
|
Operator: ts_decay_linear(x, d, dense = false) |
||||||
|
Description: Returns the linear decay on x for the past d days. Dense parameter=false means operator works in sparse mode and we treat NaN as 0. In dense mode we do not. |
||||||
|
Operator: ts_delay(x, d) |
||||||
|
Description: Returns x value d days ago |
||||||
|
Operator: ts_delta(x, d) |
||||||
|
Description: Returns x - ts_delay(x, d) |
||||||
|
Operator: ts_mean(x, d) |
||||||
|
Description: Returns average value of x for the past d days. |
||||||
|
Operator: ts_product(x, d) |
||||||
|
Description: Returns product of x for the past d days |
||||||
|
Operator: ts_quantile(x,d, driver="gaussian" ) |
||||||
|
Description: It calculates ts_rank and apply to its value an inverse cumulative density function from driver distribution. Possible values of driver (optional ) are "gaussian", "uniform", "cauchy" distribution where "gaussian" is the default. |
||||||
|
Operator: ts_rank(x, d, constant = 0) |
||||||
|
Description: Rank the values of x for each instrument over the past d days, then return the rank of the current value + constant. If not specified, by default, constant = 0. |
||||||
|
Operator: ts_regression(y, x, d, lag = 0, rettype = 0) |
||||||
|
Description: Returns various parameters related to regression function |
||||||
|
Operator: ts_scale(x, d, constant = 0) |
||||||
|
Description: Returns (x - ts_min(x, d)) / (ts_max(x, d) - ts_min(x, d)) + constant. This operator is similar to scale down operator but acts in time series space |
||||||
|
Operator: ts_std_dev(x, d) |
||||||
|
Description: Returns standard deviation of x for the past d days |
||||||
|
Operator: ts_step(1) |
||||||
|
Description: Returns days' counter |
||||||
|
Operator: ts_sum(x, d) |
||||||
|
Description: Sum values of x for the past d days. |
||||||
|
Operator: ts_zscore(x, d) |
||||||
|
Description: Z-score is a numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean: (x - tsmean(x,d)) / tsstddev(x,d). This operator may help reduce outliers and drawdown. |
||||||
|
Operator: normalize(x, useStd = false, limit = 0.0) |
||||||
|
Description: Calculates the mean value of all valid alpha values for a certain date, then subtracts that mean from each element |
||||||
|
Operator: quantile(x, driver = gaussian, sigma = 1.0) |
||||||
|
Description: Rank the raw vector, shift the ranked Alpha vector, apply distribution (gaussian, cauchy, uniform). If driver is uniform, it simply subtract each Alpha value with the mean of all Alpha values in the Alpha vector |
||||||
|
Operator: rank(x, rate=2) |
||||||
|
Description: Ranks the input among all the instruments and returns an equally distributed number between 0.0 and 1.0. For precise sort, use the rate as 0 |
||||||
|
Operator: scale(x, scale=1, longscale=1, shortscale=1) |
||||||
|
Description: Scales input to booksize. We can also scale the long positions and short positions to separate scales by mentioning additional parameters to the operator |
||||||
|
Operator: winsorize(x, std=4) |
||||||
|
Description: Winsorizes x to make sure that all values in x are between the lower and upper limits, which are specified as multiple of std. |
||||||
|
Operator: zscore(x) |
||||||
|
Description: Z-score is a numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean |
||||||
|
Operator: vec_avg(x) |
||||||
|
Description: Taking mean of the vector field x |
||||||
|
Operator: vec_sum(x) |
||||||
|
Description: Sum of vector field x |
||||||
|
Operator: bucket(rank(x), range="0, 1, 0.1" or buckets = "2,5,6,7,10") |
||||||
|
Description: Convert float values into indexes for user-specified buckets. Bucket is useful for creating group values, which can be passed to GROUP as input |
||||||
|
Operator: trade_when(x, y, z) |
||||||
|
Description: Used in order to change Alpha values only under a specified condition and to hold Alpha values in other cases. It also allows to close Alpha positions (assign NaN values) under a specified condition |
||||||
|
Operator: group_backfill(x, group, d, std = 4.0) |
||||||
|
Description: If a certain value for a certain date and instrument is NaN, from the set of same group instruments, calculate winsorized mean of all non-NaN values over last d days |
||||||
|
Operator: group_mean(x, weight, group) |
||||||
|
Description: All elements in group equals to the mean |
||||||
|
Operator: group_neutralize(x, group) |
||||||
|
Description: Neutralizes Alpha against groups. These groups can be subindustry, industry, sector, country or a constant |
||||||
|
Operator: group_rank(x, group) |
||||||
|
Description: Each elements in a group is assigned the corresponding rank in this group |
||||||
|
Operator: group_scale(x, group) |
||||||
|
Description: Normalizes the values in a group to be between 0 and 1. (x - groupmin) / (groupmax - groupmin) |
||||||
|
Operator: group_zscore(x, group) |
||||||
|
Description: Calculates group Z-score - numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean. zscore = (data - mean) / stddev of x for each instrument within its group. |
||||||
|
========================= 操作符结束 ======================================= |
||||||
|
|
||||||
|
========================= 数据字段开始 ======================================= |
||||||
|
注意: data_set_name: 后面的是数据字段(可以使用), description: 此字段后面的是数据字段对应的描述或使用说明(不能使用), description_cn字段后面的内容是中文使用说明(不能使用) |
||||||
|
|
||||||
|
{'data_set_name': '可以使用:fnd6_capxv', 'description': '不可使用,仅供参考:Capital Expend Property, Plant and Equipment Schd V'} |
||||||
|
{'data_set_name': '可以使用:fnd6_ciother', 'description': '不可使用,仅供参考:Comp. Inc. - Other Adj.'} |
||||||
|
{'data_set_name': '可以使用:fnd6_cisecgl', 'description': '不可使用,仅供参考:Comp Inc - Securities Gains/Losses'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_spcedq', 'description': '不可使用,仅供参考:S&P Core Earnings EPS Diluted'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_ciotherq', 'description': '不可使用,仅供参考:Comp Inc - Other Adj'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_spceepsp12', 'description': '不可使用,仅供参考:S&P Core 12MM EPS - Basic - Preliminary'} |
||||||
|
{'data_set_name': '可以使用:sales_ps', 'description': '不可使用,仅供参考:Sales per Share (Quarterly)'} |
||||||
|
{'data_set_name': '可以使用:fscore_bfl_total', 'description': '不可使用,仅供参考:The final score M-Score is a weighted average of both the Pentagon surface score and the Pentagon acceleration score.'} |
||||||
|
{'data_set_name': '可以使用:fscore_total', 'description': '不可使用,仅供参考:The final score M-Score is a weighted average of both the Pentagon surface score and the Pentagon acceleration score.'} |
||||||
|
{'data_set_name': '可以使用:multi_factor_acceleration_score_derivative', 'description': '不可使用,仅供参考:Change in the acceleration of multi-factor score compared to previous period.'} |
||||||
|
{'data_set_name': '可以使用:anl4_netdebt_flag', 'description': '不可使用,仅供参考:Net debt - forecast type (revision/new/...)'} |
||||||
|
{'data_set_name': '可以使用:min_reported_eps_guidance', 'description': '不可使用,仅供参考:Reported Earnings Per Share - Minimum guidance value for the annual period'} |
||||||
|
{'data_set_name': '可以使用:pv13_com_rk_au', 'description': '不可使用,仅供参考:the HITS authority score of competitors'} |
||||||
|
{'data_set_name': '可以使用:pv13_h2_min2_1k_sector', 'description': '不可使用,仅供参考:Grouping fields for top 1000'} |
||||||
|
{'data_set_name': '可以使用:pv13_h_min22_1000_sector', 'description': '不可使用,仅供参考:Grouping fields for top 1000'} |
||||||
|
{'data_set_name': '可以使用:pv13_h_min24_500_sector', 'description': '不可使用,仅供参考:Grouping fields for top 500'} |
||||||
|
{'data_set_name': '可以使用:pv13_h_min2_focused_sector', 'description': '不可使用,仅供参考:Grouping fields for top 200'} |
||||||
|
{'data_set_name': '可以使用:pv13_h_min52_1k_sector', 'description': '不可使用,仅供参考:Grouping fields for top 1000'} |
||||||
|
{'data_set_name': '可以使用:news_max_up_amt', 'description': '不可使用,仅供参考:The after the news high minus the price at the time of the news'} |
||||||
|
{'data_set_name': '可以使用:nws18_sse', 'description': '不可使用,仅供参考:Sentiment of phrases impacting the company'} |
||||||
|
{'data_set_name': '可以使用:fn_comp_not_rec_stock_options_a', 'description': '不可使用,仅供参考:Unrecognized cost of unvested stock option awards.'} |
||||||
|
{'data_set_name': '可以使用:fn_comp_not_rec_stock_options_q', 'description': '不可使用,仅供参考:Unrecognized cost of unvested stock option awards.'} |
||||||
|
{'data_set_name': '可以使用:fn_def_tax_liab_a', 'description': '不可使用,仅供参考:Amount, after deferred tax asset, of deferred tax liability attributable to taxable differences without jurisdictional netting.'} |
||||||
|
{'data_set_name': '可以使用:fn_treasury_stock_shares_a', 'description': '不可使用,仅供参考:Number of common and preferred shares that were previously issued and that were repurchased by the issuing entity and held in treasury on the financial statement date. This stock has no voting rights and receives no dividends.'} |
||||||
|
{'data_set_name': '可以使用:anl4_eaz2lafv110_prevval', 'description': '不可使用,仅供参考:The previous estimation of financial item'} |
||||||
|
{'data_set_name': '可以使用:pv13_hierarchy_min20_3k_513_sector', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:pv13_r2_liquid_min2_sector', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:option_breakeven_10', 'description': "不可使用,仅供参考:Price at which a stock's options with expiration 10 days in the future break even based on its recent bid/ask mean."} |
||||||
|
{'data_set_name': '可以使用:pv13_new_3l_scibr', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:nws12_mainz_postvwap', 'description': '不可使用,仅供参考:Post session volume weighted average price'} |
||||||
|
{'data_set_name': '可以使用:nws12_afterhsz_01l', 'description': '不可使用,仅供参考:Number of minutes that elapsed before price went up 10 percentage points'} |
||||||
|
{'data_set_name': '可以使用:est_epsr', 'description': '不可使用,仅供参考:GAAP Earnings per share - mean of estimations'} |
||||||
|
{'data_set_name': '可以使用:fnd6_zipcode', 'description': '不可使用,仅供参考:ZIP code related to the company'} |
||||||
|
{'data_set_name': '可以使用:fnd2_a_ptoacqbnsesg', 'description': '不可使用,仅供参考:The cash outflow associated with the acquisition of business during the period. The cash portion only of the acquisition price.'} |
||||||
|
{'data_set_name': '可以使用:min_adjusted_net_income_guidance', 'description': '不可使用,仅供参考:Adjusted net income - minimum guidance value'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_esoprq', 'description': '不可使用,仅供参考:Preferred ESOP Obligation - Redeemable'} |
||||||
|
{'data_set_name': '可以使用:parkinson_volatility_20', 'description': "不可使用,仅供参考:Parkinson model's historical volatility over 20 days"} |
||||||
|
{'data_set_name': '可以使用:fn_debt_instrument_interest_rate_stated_percentage_a', 'description': '不可使用,仅供参考:Stated percentage of interest rate on debt'} |
||||||
|
{'data_set_name': '可以使用:implied_volatility_mean_skew_360', 'description': '不可使用,仅供参考:At-the-money option-implied volatility mean skew for 360 days'} |
||||||
|
{'data_set_name': '可以使用:fnd6_cptnewqv1300_lctq', 'description': '不可使用,仅供参考:Current Liabilities - Total'} |
||||||
|
{'data_set_name': '可以使用:max_custom_eps_guidance', 'description': '不可使用,仅供参考:Custom Earnings per share - The highest guidance value'} |
||||||
|
{'data_set_name': '可以使用:anl4_qfd1_az_wol_vid', 'description': '不可使用,仅供参考:Dividend per share - The lowest value among forecasts'} |
||||||
|
{'data_set_name': '可以使用:fn_employee_related_liab_q', 'description': '不可使用,仅供参考:Total of the carrying values as of the balance sheet date of obligations incurred through that date and payable for obligations related to services received from employees, such as accrued salaries and bonuses, payroll taxes and fringe benefits. For classified balance sheets, used to reflect the current portion of the liabilities (due within 1 year or within the normal operating cycle if longer); for unclassified balance sheets, used to reflect the total liabilities (regardless of due date).'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_stkcoq', 'description': '不可使用,仅供参考:Stock Compensation Expense'} |
||||||
|
{'data_set_name': '可以使用:fnd6_dps', 'description': '不可使用,仅供参考:Depreciation and Amortization'} |
||||||
|
{'data_set_name': '可以使用:nws12_mainz_57p', 'description': '不可使用,仅供参考:The minimum of L or S above for 7.5-minute bucket'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_spcepq', 'description': '不可使用,仅供参考:S&P Core Earnings - Preliminary'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_glceeps12', 'description': '不可使用,仅供参考:Gain/Loss on Sale (Core Earnings Adjusted) Basic EPS Effect 12MM'} |
||||||
|
{'data_set_name': '可以使用:min_stock_option_expense_guidance_2', 'description': '不可使用,仅供参考:Minimum guidance value for stock option expense on an annual basis'} |
||||||
|
{'data_set_name': '可以使用:nws12_prez_newrecord', 'description': '不可使用,仅供参考:Tracks whether the news is the first instance or a duplicate'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newa1v1300_invch', 'description': '不可使用,仅供参考:Mortgages - Decrease (Increase)'} |
||||||
|
{'data_set_name': '可以使用:min_net_income_guidance', 'description': '不可使用,仅供参考:Net profit - minimum guidance value'} |
||||||
|
{'data_set_name': '可以使用:rp_css_business', 'description': '不可使用,仅供参考:Composite sentiment score of business-related news'} |
||||||
|
{'data_set_name': '可以使用:pretax_income_reported_min_guidance', 'description': '不可使用,仅供参考:Reported Pretax income - minimum guidance value'} |
||||||
|
{'data_set_name': '可以使用:anl4_cff_mean', 'description': '不可使用,仅供参考:Cash Flow From Financing - mean of estimations'} |
||||||
|
{'data_set_name': '可以使用:anl4_qf_az_cfps_median', 'description': '不可使用,仅供参考:Cash Flow Per Share - Median value among forecasts'} |
||||||
|
{'data_set_name': '可以使用:fnd2_a_unrgtxbnfitxpenlintacd', 'description': '不可使用,仅供参考:Amount accrued for interest on an underpayment of income taxes and penalties related to a tax position claimed or expected to be claimed in the tax return.'} |
||||||
|
{'data_set_name': '可以使用:nws12_afterhsz_4l', 'description': '不可使用,仅供参考:Number of minutes that elapsed before price went up 4 percentage points'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_pncippq', 'description': '不可使用,仅供参考:Core Pension Interest Adjustment Pretax Preliminary'} |
||||||
|
{'data_set_name': '可以使用:anl4_qf_az_cfps_mean', 'description': '不可使用,仅供参考:Cash Flow Per Share - average of estimations'} |
||||||
|
{'data_set_name': '可以使用:rel_num_cust', 'description': "不可使用,仅供参考:number of the instrument's customers"} |
||||||
|
{'data_set_name': '可以使用:nws12_prez_41rta', 'description': '不可使用,仅供参考:Fourteen-day Average True Range'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_pnrshoq', 'description': '不可使用,仅供参考:Nonred Pfd Shares Outs (000) - Quarterly'} |
||||||
|
{'data_set_name': '可以使用:dividend_min_guidance_value', 'description': '不可使用,仅供参考:Minimum guidance value for Dividend per share on an annual basis'} |
||||||
|
{'data_set_name': '可以使用:option_breakeven_720', 'description': "不可使用,仅供参考:Price at which a stock's options with expiration 720 days in the future break even based on its recent bid/ask mean."} |
||||||
|
{'data_set_name': '可以使用:nws12_mainz_prev_vol', 'description': "不可使用,仅供参考:Previous day's session volume"} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_gdwlq', 'description': '不可使用,仅供参考:Goodwill (net)'} |
||||||
|
{'data_set_name': '可以使用:forward_price_10', 'description': '不可使用,仅供参考:Forward price at 10 days derived from a synthetic long option with payoff similar to long stock + option dynamics. Combination of long ATM call and short ATM put.'} |
||||||
|
{'data_set_name': '可以使用:ebit', 'description': '不可使用,仅供参考:Earnings Before Interest and Taxes'} |
||||||
|
{'data_set_name': '可以使用:fnd6_xsgas', 'description': '不可使用,仅供参考:Selling, General & Administrative'} |
||||||
|
{'data_set_name': '可以使用:anl4_qf_az_wol_vid', 'description': '不可使用,仅供参考:Dividend per share - The lowest value among forecasts'} |
||||||
|
{'data_set_name': '可以使用:sales_estimate_dispersion', 'description': '不可使用,仅供参考:Standard deviation of Sales estimations for the annual period.'} |
||||||
|
{'data_set_name': '可以使用:fnd6_npq', 'description': '不可使用,仅供参考:Notes Payable'} |
||||||
|
{'data_set_name': '可以使用:nws12_afterhsz_maxdown', 'description': '不可使用,仅供参考:Percent change from the price at the time of the news to the after the news low'} |
||||||
|
{'data_set_name': '可以使用:min_customized_eps_guidance', 'description': '不可使用,仅供参考:Customized Earnings per share - Minimum guidance value for the annual period'} |
||||||
|
{'data_set_name': '可以使用:anl4_afv4_minguidance', 'description': '不可使用,仅供参考:Min guidance value'} |
||||||
|
{'data_set_name': '可以使用:nws12_prez_60_min', 'description': '不可使用,仅供参考:The percent change in price in the first 60 minutes following the news release'} |
||||||
|
{'data_set_name': '可以使用:anl4_ptp_median', 'description': '不可使用,仅供参考:Pretax income - median of estimations'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newa1v1300_ibadj', 'description': '不可使用,仅供参考:Income Before Extraordinary Items - Adjusted for Common Stock Equivalents'} |
||||||
|
{'data_set_name': '可以使用:anl4_adjusted_netincome_ft', 'description': '不可使用,仅供参考:Adjusted net income - forecast type (revision/new/...)'} |
||||||
|
{'data_set_name': '可以使用:fn_employee_related_liab_a', 'description': '不可使用,仅供参考:Total of the carrying values as of the balance sheet date of obligations incurred through that date and payable for obligations related to services received from employees, such as accrued salaries and bonuses, payroll taxes and fringe benefits. For classified balance sheets, used to reflect the current portion of the liabilities (due within 1 year or within the normal operating cycle if longer); for unclassified balance sheets, used to reflect the total liabilities (regardless of due date).'} |
||||||
|
{'data_set_name': '可以使用:fn_prepaid_expense_a', 'description': '不可使用,仅供参考:Carrying amount for an unclassified balance sheet date of expenditures made in advance of when the economic benefit of the cost will be realized, and which will be expensed in future periods with the passage of time or when a triggering event occurs. For a classified balance sheet, represents the noncurrent portion of prepaid expenses (the current portion has a separate concept).'} |
||||||
|
{'data_set_name': '可以使用:rp_nip_society', 'description': '不可使用,仅供参考:News impact projection of society-related news'} |
||||||
|
{'data_set_name': '可以使用:est_dividend_ps', 'description': '不可使用,仅供参考:Dividend per share - average of estimations'} |
||||||
|
{'data_set_name': '可以使用:fn_ppne_gross_a', 'description': '不可使用,仅供参考:Amount before accumulated depreciation, depletion, and amortization of physical assets used in the normal conduct of business and not intended for resale. Examples include, but are not limited to, land, buildings, machinery and equipment, office equipment, and furniture and fixtures.'} |
||||||
|
{'data_set_name': '可以使用:pv13_di_5l', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_prcaq', 'description': '不可使用,仅供参考:Core Post Retirement Adjustment'} |
||||||
|
{'data_set_name': '可以使用:correlation_last_90_days_spy', 'description': '不可使用,仅供参考:Correlation to SPY in 90 Days'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_acomincq', 'description': '不可使用,仅供参考:Accumulated Other Comprehensive Income (Loss)'} |
||||||
|
{'data_set_name': '可以使用:rp_css_product', 'description': '不可使用,仅供参考:Composite sentiment score of product and service-related news'} |
||||||
|
{'data_set_name': '可以使用:fnd6_mfmq_piq', 'description': '不可使用,仅供参考:Pretax Income'} |
||||||
|
{'data_set_name': '可以使用:fn_proceeds_from_stock_options_exercised_q', 'description': '不可使用,仅供参考:The cash inflow associated with the amount received from holders exercising their stock options. This item inherently excludes any excess tax benefit, which the entity may have realized and reported separately.'} |
||||||
|
{'data_set_name': '可以使用:implied_volatility_mean_skew_1080', 'description': '不可使用,仅供参考:At-the-money option-implied volatility mean skew for 3 years'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_teqq', 'description': "不可使用,仅供参考:Stockholders' Equity - Total - Quarterly"} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqeventv110_invoq', 'description': '不可使用,仅供参考:Inventory - Other'} |
||||||
|
{'data_set_name': '可以使用:anl4_netprofita_std', 'description': '不可使用,仅供参考:Adjusted net income - std of estimations'} |
||||||
|
{'data_set_name': '可以使用:anl4_netprofita_value', 'description': '不可使用,仅供参考:Adjusted net income- announced financial value'} |
||||||
|
{'data_set_name': '可以使用:fnd6_cptmfmq_opepsq', 'description': '不可使用,仅供参考:Earnings Per Share from Operations'} |
||||||
|
{'data_set_name': '可以使用:fn_comprehensive_income_net_of_tax_q', 'description': '不可使用,仅供参考:Amount after tax of increase (decrease) in equity from transactions and other events and circumstances from net income and other comprehensive income, attributable to parent entity. Excludes changes in equity resulting from investments by owners and distributions to owners.'} |
||||||
|
{'data_set_name': '可以使用:pv13_h_min2_focused_pureplay_3000_sector', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:fnd6_newqv1300_lnoq', 'description': '不可使用,仅供参考:Liabilities Netting & Other Adjustments'} |
||||||
|
{'data_set_name': '可以使用:anl4_ptp_mean', 'description': '不可使用,仅供参考:Pretax income - mean of estimations'} |
||||||
|
{'data_set_name': '可以使用:sales_min_guidance_value', 'description': '不可使用,仅供参考:Minimum sales guidance for the annual period.'} |
||||||
|
{'data_set_name': '可以使用:fnd6_sstk', 'description': '不可使用,仅供参考:Sale of Common and Preferred Stock'} |
||||||
|
{'data_set_name': '可以使用:nws12_prez_opengap', 'description': '不可使用,仅供参考:(DayOpen - PrevClose) / PrevClose.'} |
||||||
|
{'data_set_name': '可以使用:sales_estimate_median_value', 'description': '不可使用,仅供参考:Sales - Median value among forecasts'} |
||||||
|
{'data_set_name': '可以使用:rp_css_assets', 'description': '不可使用,仅供参考:Composite sentiment score of assets news'} |
||||||
|
{'data_set_name': '可以使用:anl4_basicconltv110_mean', 'description': '不可使用,仅供参考:Mean of estimations'} |
||||||
|
{'data_set_name': '可以使用:rp_ess_credit', 'description': '不可使用,仅供参考:Event sentiment score of credit news'} |
||||||
|
{'data_set_name': '可以使用:pv13_6l_scibr', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:fnd6_cptnewqv1300_oiadpq', 'description': '不可使用,仅供参考:Operating Income After Depreciation - Quarterly'} |
||||||
|
{'data_set_name': '可以使用:pv13_hierarchy_min10_1000_513_sector', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:pv13_r2_min10_3000_sector', 'description': '不可使用,仅供参考:grouping fields'} |
||||||
|
{'data_set_name': '可以使用:eps_guidance_value_quarterly', 'description': '不可使用,仅供参考:Earnings Per Share - Basic value'} |
||||||
|
{'data_set_name': '可以使用:anl4_capex_std', 'description': '不可使用,仅供参考:Capital Expenditures - standard deviation of estimations'} |
||||||
|
{'data_set_name': '可以使用:option_breakeven_150', 'description': "不可使用,仅供参考:Price at which a stock's options with expiration 150 days in the future break even based on its recent bid/ask mean."} |
||||||
|
{'data_set_name': '可以使用:pretax_income_max_guidance_qtr', 'description': '不可使用,仅供参考:The maximum guidance value for Pretax income.'} |
||||||
|
{'data_set_name': '可以使用:nws12_prez_02s', 'description': '不可使用,仅供参考:Number of minutes that elapsed before price went down 20 percentage points'} |
||||||
|
{'data_set_name': '可以使用:anl4_fsdtlestmtbscv104_item', 'description': '不可使用,仅供参考:Financial item'} |
||||||
|
{'data_set_name': '可以使用:nws12_afterhsz_01p', 'description': '不可使用,仅供参考:The minimum of L or S above for 10 minute bucket'} |
||||||
|
{'data_set_name': '可以使用:fnd2_a_flintasamt1expyfour', 'description': '不可使用,仅供参考:Amount of amortization expense for assets, excluding financial assets and goodwill, lacking physical substance with a finite life expected to be recognized during the 4th fiscal year following the latest fiscal year. Excludes interim and annual periods when interim periods are reported on a rolling approach, from latest balance sheet date.'} |
||||||
|
{'data_set_name': '可以使用:fn_business_acq_ppne_a', 'description': '不可使用,仅供参考:Business Combination, Assumed Property, Plant and Equipment'} |
||||||
|
{'data_set_name': '可以使用:nws12_prez_3l', 'description': '不可使用,仅供参考:Number of minutes that elapsed before price went up 3 percentage points'} |
||||||
|
{'data_set_name': '可以使用:fnd6_cptnewqeventv110_rectq', 'description': '不可使用,仅供参考:Receivables - Total'} |
||||||
|
========================= 数据字段结束 ======================================= |
||||||
|
|
||||||
|
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合 |
||||||
@ -1 +1,11 @@ |
|||||||
["mau", "dau", "active_user", "engagement_time", "session_duration", "user_retention", "churn_rate", "ltv", "cac", "arpu", "customer_acquisition", "user_growth", "revenue_growth", "digital_channel", "app_usage", "web_traffic", "conversion_rate", "stickiness", "viral_coefficient", "net_promoter_score", "customer_satisfaction", "subscription", "recurring_revenue", "monthly_revenue", "daily_revenue", "paying_user", "freemium", "in_app_purchase", "ad_revenue", "monetization", "customer_segment", "user_behavior", "page_view", "click_through_rate", "bounce_rate", "organic_traffic", "paid_traffic", "social_media", "community", "private_traffic", "kpi", "metric", "performance"] |
Name |
||||||
|
Supply Chain Financial Resilience Factor |
||||||
|
|
||||||
|
Hypothesis |
||||||
|
Supply chain financial resilience reflects the stability and risk resistance of capital flow between a company and its upstream and downstream partners. During periods of macroeconomic tightening or industry credit events, companies with fragile supply chain financial networks (e.g., over-reliance on a single financing channel, highly concentrated accounts receivable, or abnormally extended payment terms) are more prone to liquidity crises, leading to stock price declines. Conversely, companies with strong supply chain financial resilience (e.g., diversified financing channels, healthy accounts payable structure, stable capital flow synergy with core partners) can better withstand shocks and may even leverage crises to increase market share, potentially resulting in more resilient stock price performance or alpha generation. |
||||||
|
|
||||||
|
Implementation Plan |
||||||
|
Integrate data fields such as accounts receivable concentration (top five customers' share), distribution of accounts payable days, proportion of commercial paper financing, and whether the company is connected to a core enterprise credit circulation platform to construct a "Supply Chain Financial Resilience Score." Use a time-series stability operator (e.g., ts_stddev) to calculate the volatility of this score during the past three periods of widening credit spreads—lower volatility indicates stronger resilience. Employ a cross-sectional bucketing operator to group securities by their industrial chain and compute the percentile rank of the resilience score within each group. Assign positive alpha weights to securities with consistently improving ranks or those stably in the top 30%. |
||||||
|
|
||||||
|
Alpha Factor Optimization Suggestions |
||||||
|
The effectiveness of this factor may be influenced by the overall monetary policy cycle. It is recommended to introduce a macro-state identification operator (e.g., defining "loose" and "tight" states based on treasury term spreads or credit spreads) to dynamically adjust the factor's weight or neutralization method under different states. During tight cycles, the allocation weight of this factor can be amplified; during loose cycles, consider reducing its weight or applying a composite neutralization approach incorporating industry and market cap neutralization to strip out the beta returns driven by systemic liquidity abundance. |
||||||
@ -1,3 +1,35 @@ |
|||||||
ts_product ts_zscore ts_mean ts_scale add sign subtract ts_delta ts_rank greater ts_av_diff ts_quantile ts_count_nans ts_covariance |
你再检查一下, 如果你使用了 |
||||||
ts_arg_min divide ts_corr multiply if_else ts_sum ts_delay group_zscore ts_arg_max ts_std_de ts_backfill |
Operator abs does not support event inputs |
||||||
以上这些操作符不能传入事件类型的数据集, 只能传入时间序列数据集 |
Operator ts_mean does not support event inputs |
||||||
|
Operator ts_scale does not support event inputs |
||||||
|
Operator add does not support event inputs |
||||||
|
Operator sign does not support event inputs |
||||||
|
Operator greater does not support event inputs |
||||||
|
Operator ts_av_diff does not support event inputs |
||||||
|
Operator ts_quantile does not support event inputs |
||||||
|
Operator ts_arg_min does not support event inputs |
||||||
|
Operator divide does not support event inputs |
||||||
|
Operator ts_corr does not support event inputs |
||||||
|
Operator ts_decay_linear does not support event inputs |
||||||
|
Operator ts_sum does not support event inputs |
||||||
|
Operator ts_delay does not support event inputs |
||||||
|
Operator ts_arg_max does not support event inputs |
||||||
|
Operator ts_std_dev does not support event inputs |
||||||
|
Operator ts_regression does not support event inputs |
||||||
|
Operator ts_backfill does not support event inputs |
||||||
|
Operator signed_power does not support event inputs |
||||||
|
Operator ts_product does not support event inputs |
||||||
|
Operator ts_zscore does not support event inputs |
||||||
|
Operator group_rank does not support event inputs |
||||||
|
Operator subtract does not support event inputs |
||||||
|
Operator ts_delta does not support event inputs |
||||||
|
Operator ts_rank does not support event inputs |
||||||
|
Operator ts_count_nans does not support event inputs |
||||||
|
Operator ts_covariance does not support event inputs |
||||||
|
Operator multiply does not support event inputs |
||||||
|
Operator if_else does not support event inputs |
||||||
|
Operator group_neutralize does not support event inputs |
||||||
|
Operator group_zscore does not support event inputs |
||||||
|
Operator winsorize does not support event inputs |
||||||
|
|
||||||
|
注意, 以上操作符不能使用事件类型的数据集, 以上操作符禁止使用事件类型的数据集!! |
||||||
@ -1,20 +1,89 @@ |
|||||||
group_zscore(ts_rank(add(ts_delta(fscore_bfl_total,20),ts_zscore(nws18_sse,60)),252),anl4_netdebt_flag) |
group_scale(ts_step(1), pv13_h_min2_focused_sector) |
||||||
ts_zscore(multiply(ts_rank(subtract(nws12_allz_result2,nws12_mainz_tonhigh),120),sign(ts_delta(fnd6_newqeventv110_cibegniq,30))),60) |
rank(power(rel_num_cust, 2)) |
||||||
group_rank(multiply(ts_scale(ts_corr(nws18_sse,fscore_bfl_total,90),90),sqrt(abs(ts_delta(nws12_afterhsz_tonhigh,60)))),anl4_netdebt_flag) |
scale(sqrt(abs(rel_num_cust))) |
||||||
ts_rank(add(ts_zscore(fscore_bfl_total,180),divide(ts_mean(nws12_allz_result2,60),ts_std_dev(nws12_mainz_tonhigh,60))),252) |
normalize(vec_avg(rel_num_cust)) |
||||||
group_zscore(subtract(ts_power(abs(ts_delta(fnd6_newqeventv110_cibegniq,45)),0.7),ts_av_diff(nws18_sse,90)),anl4_netdebt_flag) |
quantile(rank(rel_num_cust)) |
||||||
multiply(ts_rank(ts_covariance(nws12_afterhsz_tonhigh,nws18_sse,120),180),group_scale(sign(ts_delta(fscore_bfl_total,20)),anl4_netdebt_flag)) |
group_mean(rel_num_cust, rel_num_cust, pv13_r2_liquid_min2_sector) |
||||||
ts_zscore(add(ts_mean(multiply(nws12_allz_result2,nws18_sse),60),ts_rank(fnd6_newqeventv110_cibegniq,90)),120) |
power(rank(ebit), 1.5) |
||||||
group_rank(ts_scale(subtract(ts_max(ts_mean(nws12_mainz_tonhigh,30),ts_mean(nws12_afterhsz_tonhigh,30)),ts_min(fscore_bfl_total,fn_liab_fair_val_q)),180),anl4_netdebt_flag) |
reverse(scale(sqrt(ebit))) |
||||||
ts_rank(multiply(ts_zscore(nws18_sse,60),signed_power(ts_delta(fscore_bfl_total,60),1.2)),252) |
normalize(vec_sum(sales_ps)) |
||||||
group_zscore(add(ts_decay_linear(nws12_allz_result2,90),ts_quantile(ts_delta(fn_liab_fair_val_a,30),60)),anl4_netdebt_flag) |
quantile(rank(sales_ps), uniform) |
||||||
subtract(ts_rank(ts_mean(fscore_bfl_total,90),180),group_scale(divide(nws18_sse,abs(ts_delta(nws12_mainz_tonhigh,20))),anl4_netdebt_flag)) |
group_scale(fscore_total, pv13_hierarchy_min20_3k_513_sector) |
||||||
ts_zscore(multiply(sqrt(ts_sum(abs(nws12_allz_result2),60)),sign(ts_corr(fnd6_newqeventv110_cibegniq,nws18_sse,120))),90) |
scale(abs(subtract(rel_num_cust, ts_step(1)), filter=true)) |
||||||
group_rank(ts_power(ts_rank(ts_av_diff(fscore_bfl_total,60),120),0.8),anl4_netdebt_flag) |
rank(signed_power(anl4_netprofita_value, 2)) |
||||||
multiply(ts_zscore(subtract(nws18_sse,ts_delay(nws18_sse,30)),60),ts_rank(fn_liab_fair_val_l2_q,90)) |
normalize(power(fscore_bfl_total, 0.75)) |
||||||
ts_rank(add(ts_corr(fscore_bfl_total,fn_liab_fair_val_a,180),ts_scale(nws12_afterhsz_tonhigh,60)),252) |
group_mean(ebit, ebit, pv13_h_min22_1000_sector) |
||||||
group_zscore(multiply(ts_delta(ts_mean(nws12_mainz_tonhigh,45),15),inverse(ts_std_dev(fnd6_newqeventv110_cibegniq,60))),anl4_netdebt_flag) |
scale(log(abs(add(rel_num_cust, sales_ps, filter=true)))) |
||||||
add(ts_zscore(fscore_bfl_total,120),group_rank(ts_quantile(nws12_allz_result2,90),anl4_netdebt_flag)) |
quantile(rank(fnd6_cptnewqv1300_oiadpq), cauchy) |
||||||
ts_rank(multiply(ts_backfill(nws18_sse,30),ts_delta(ts_covariance(fn_liab_fair_val_q,fscore_bfl_total,60),30)),180) |
reverse(rank(multiply(rel_num_cust, ebit, filter=true))) |
||||||
group_scale(subtract(ts_max(ts_zscore(nws12_afterhsz_tonhigh,60),ts_zscore(nws12_mainz_tonhigh,60)),ts_min(fnd6_newqeventv110_cibegniq,fn_liab_fair_val_l3_q)),anl4_netdebt_flag) |
group_scale(sales_ps, pv13_h_min24_500_sector) |
||||||
ts_zscore(multiply(ts_rank(nws18_sse,252),log(abs(add(fscore_bfl_total,1)))),180) |
normalize(sqrt(abs(fnd6_newqv1300_teqq))) |
||||||
|
rank(add(ebit, fscore_total, filter=true)) |
||||||
|
scale(signed_power(rel_num_cust, 3)) |
||||||
|
quantile(group_mean(sales_ps, sales_ps, pv13_h_min52_1k_sector)) |
||||||
|
reverse(scale(log(abs(anl4_ptp_mean)))) |
||||||
|
group_scale(anl4_netprofita_value, pv13_new_3l_scibr) |
||||||
|
rank(multiply(ebit, fscore_bfl_total, filter=true)) |
||||||
|
normalize(power(rel_num_cust, 0.5)) |
||||||
|
scale(abs(subtract(sales_ps, ebit, filter=true))) |
||||||
|
quantile(rank(fnd6_cptnewqv1300_lctq), gaussian) |
||||||
|
|
||||||
|
group_zscore(ts_rank(add(divide(ts_sum(sales_ps, 250), ts_sum(ebit, 250)), ts_av_diff(ts_zscore(sales_ps, 60), 20)), 60), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
group_zscore(ts_rank(multiply(ts_delta(sales_ps, 5), ts_corr(sales_ps, ebit, 20)), 120), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
subtract(ts_rank(ts_zscore(sales_ps, 60), 250), ts_rank(ts_zscore(ebit, 60), 250)) |
||||||
|
|
||||||
|
multiply(sign(ts_delta(sales_ps, 10)), ts_rank(ts_av_diff(sales_ps, 20), 60)) |
||||||
|
|
||||||
|
ts_rank(add(ts_zscore(sales_ps, 60), ts_zscore(divide(sales_ps, ebit), 60)), 120) |
||||||
|
|
||||||
|
if_else(ts_rank(sales_ps, 60) > ts_rank(ebit, 60), ts_rank(sales_ps, 60), ts_rank(ebit, 60)) |
||||||
|
|
||||||
|
group_zscore(ts_rank(divide(ts_sum(sales_ps, 120), ts_sum(ebit, 120)), 120), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
subtract(ts_rank(ts_mean(sales_ps, 20), 60), ts_rank(ts_mean(ebit, 20), 60)) |
||||||
|
|
||||||
|
multiply(ts_delta(sales_ps, 5), ts_corr(sales_ps, ebit, 20)) |
||||||
|
|
||||||
|
ts_rank(divide(ts_zscore(sales_ps, 60), ts_zscore(ebit, 60)), 120) |
||||||
|
|
||||||
|
group_zscore(ts_rank(add(ts_delta(sales_ps, 5), ts_av_diff(divide(sales_ps, ebit), 10)), 60), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
ts_rank(multiply(sign(ts_delta(sales_ps, 10)), ts_zscore(sales_ps, 60)), 120) |
||||||
|
|
||||||
|
subtract(ts_rank(ts_sum(sales_ps, 20), 60), ts_rank(ts_sum(ebit, 20), 60)) |
||||||
|
|
||||||
|
if_else(ts_rank(sales_ps, 60) > 0.7, ts_rank(divide(sales_ps, ebit), 60), ts_rank(sales_ps, 60)) |
||||||
|
|
||||||
|
group_zscore(ts_rank(ts_corr(sales_ps, ebit, 20), 60), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
multiply(ts_rank(ts_delta(sales_ps, 5), 60), ts_rank(ts_av_diff(sales_ps, 10), 60)) |
||||||
|
|
||||||
|
ts_rank(subtract(ts_zscore(sales_ps, 60), ts_zscore(ebit, 60)), 120) |
||||||
|
|
||||||
|
add(ts_rank(ts_mean(sales_ps, 20), 60), ts_rank(ts_mean(divide(sales_ps, ebit), 20), 60)) |
||||||
|
|
||||||
|
group_zscore(ts_rank(multiply(ts_delta(sales_ps, 5), ts_zscore(ebit, 60)), 120), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
if_else(ts_delta(sales_ps, 10) > 0, ts_rank(sales_ps, 60), ts_rank(ebit, 60)) |
||||||
|
|
||||||
|
subtract(ts_rank(ts_product(sales_ps, 20), 60), ts_rank(ts_product(ebit, 20), 60)) |
||||||
|
|
||||||
|
ts_rank(divide(ts_delta(sales_ps, 5), ts_delta(ebit, 5)), 120) |
||||||
|
|
||||||
|
multiply(ts_rank(ts_corr(sales_ps, ebit, 20), 60), ts_rank(ts_av_diff(sales_ps, 10), 60)) |
||||||
|
|
||||||
|
group_zscore(ts_rank(add(ts_zscore(sales_ps, 60), ts_zscore(ebit, 60)), 120), pv13_h_min2_focused_sector) |
||||||
|
|
||||||
|
ts_rank(subtract(ts_sum(sales_ps, 20), ts_sum(ebit, 20)), 60) |
||||||
|
|
||||||
|
if_else(ts_rank(divide(sales_ps, ebit), 60) > ts_rank(sales_ps, 60), ts_rank(divide(sales_ps, ebit), 60), ts_rank(sales_ps, 60)) |
||||||
|
|
||||||
|
subtract(ts_rank(ts_av_diff(sales_ps, 10), 60), ts_rank(ts_av_diff(ebit, 10), 60)) |
||||||
|
|
||||||
|
multiply(ts_delta(sales_ps, 5), ts_rank(ts_zscore(ebit, 60), 120)) |
||||||
|
|
||||||
|
ts_rank(add(ts_mean(sales_ps, 20), ts_mean(ebit, 20)), 120) |
||||||
|
|
||||||
|
group_zscore(ts_rank(divide(ts_delta(sales_ps, 5), ts_av_diff(ebit, 10)), 60), pv13_h_min2_focused_sector) |
||||||
Loading…
Reference in new issue