jack 4 weeks ago
parent 0da3254831
commit 7ac1c4d161
  1. 39
      generated_alpha/2026/01/05/140045.txt
  2. 39
      generated_alpha/2026/01/05/140121.txt
  3. 39
      generated_alpha/2026/01/05/150414.txt
  4. 39
      generated_alpha/2026/01/05/150439.txt
  5. 39
      generated_alpha/2026/01/06/140740.txt
  6. 39
      generated_alpha/2026/01/06/140821.txt
  7. 39
      generated_alpha/2026/01/08/160249.txt
  8. 39
      generated_alpha/2026/01/08/160334.txt
  9. 39
      generated_alpha/2026/01/08/160426.txt
  10. 18
      main.py
  11. 174
      manual_prompt/2026/01/05/manual_prompt_20260105140024.txt
  12. 177
      manual_prompt/2026/01/05/manual_prompt_20260105150404.txt
  13. 185
      manual_prompt/2026/01/06/manual_prompt_20260106140727.txt
  14. 196
      manual_prompt/2026/01/07/manual_prompt_20260107145409.txt
  15. 191
      manual_prompt/2026/01/07/manual_prompt_20260107152619.txt
  16. 195
      manual_prompt/2026/01/07/manual_prompt_20260107174407.txt
  17. 181
      manual_prompt/2026/01/08/manual_prompt_20260108160239.txt
  18. 15
      prepare_prompt/alpha_prompt.txt
  19. 2
      prepare_prompt/keys_text.txt
  20. 79
      手动处理每天alpha.txt

@ -0,0 +1,39 @@
ts_delta(subtract(ts_delta(fn_comp_not_rec_a, 63), ts_delta(fn_comp_not_rec_stock_options_a, 63)), 21)
group_neutralize(ts_rank(subtract(ts_mean(fn_liab_fair_val_a, 42), ts_mean(fn_comp_not_rec_a, 42)), bucket(ts_mean(fn_comp_not_rec_stock_options_q, 21))))
ts_corr(ts_delay(fn_comp_not_rec_stock_options_a, 10), ts_delta(fn_liab_fair_val_a, 21), 63)
multiply(ts_zscore(divide(fn_comp_not_rec_a, fn_liab_fair_val_a), 42), reverse(ts_rank(fn_comp_not_rec_stock_options_q, 21)))
subtract(ts_sum(fn_comp_not_rec_a, 63), ts_sum(fn_comp_not_rec_stock_options_a, 63))
ts_regression(fn_liab_fair_val_a, fn_comp_not_rec_stock_options_q, 42, 0, 0)
if_else(ts_delta(fn_comp_not_rec_a, 21) > ts_delta(fn_comp_not_rec_stock_options_q, 21), ts_mean(fn_liab_fair_val_a, 21), reverse(ts_mean(fn_comp_not_rec_stock_options_a, 21)))
group_zscore(ts_av_diff(fn_comp_not_rec_stock_options_q, 42), bucket(ts_rank(fn_liab_fair_val_a, 21)))
ts_backfill(subtract(fn_comp_not_rec_a, fn_comp_not_rec_stock_options_q), 21, 1, "NAN")
ts_scale(divide(fn_liab_fair_val_a, fn_comp_not_rec_stock_options_a), 42, 0.1)
add(ts_covariance(fn_comp_not_rec_a, fn_comp_not_rec_stock_options_q, 63), ts_covariance(fn_liab_fair_val_a, fn_comp_not_rec_stock_options_a, 63))
power(ts_delta(fn_comp_not_rec_stock_options_q, 10), ts_delta(fn_liab_fair_val_a, 10))
ts_decay_linear(subtract(fn_comp_not_rec_a, fn_comp_not_rec_stock_options_a), 21, false)
multiply(ts_arg_min(fn_liab_fair_val_a, 42), ts_arg_max(fn_comp_not_rec_stock_options_q, 42))
normalize(ts_sum(divide(fn_comp_not_rec_a, fn_comp_not_rec_stock_options_a), 21), true, 0.0)
ts_quantile(subtract(fn_liab_fair_val_a, fn_comp_not_rec_stock_options_q), 42, "gaussian")
rank(ts_mean(add(fn_comp_not_rec_a, fn_comp_not_rec_stock_options_a), 21), 0)
group_rank(ts_std_dev(fn_liab_fair_val_a, 42), bucket(ts_mean(fn_comp_not_rec_stock_options_q, 21)))
winsorize(ts_delta(divide(fn_comp_not_rec_a, fn_comp_not_rec_stock_options_q), 21), 3)
ts_count_nans(subtract(fn_liab_fair_val_a, fn_comp_not_rec_stock_options_a), 42)

@ -0,0 +1,39 @@
subtract(ts_delta(fnd6_newqeventv110_cibegniq, 90), ts_delta(fn_comp_not_rec_a, 90))
multiply(ts_zscore(fnd6_newqeventv110_cibegniq, 180), sign(ts_delta(fn_comp_not_rec_stock_options_q, 60)))
group_neutralize(divide(ts_mean(fnd6_newqeventv110_cibegniq, 120), ts_std_dev(fnd6_newqeventv110_cibegniq, 120)), 'sector')
ts_rank(subtract(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_a), 252)
group_zscore(ts_av_diff(fnd6_newqeventv110_cibegniq, 90), 'industry')
ts_decay_linear(multiply(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_stock_options_q), 60, false)
if_else(gt(ts_delta(fn_comp_not_rec_a, 30), 0), ts_zscore(fnd6_newqeventv110_cibegniq, 60), reverse(ts_std_dev(fnd6_newqeventv110_cibegniq, 90)))
ts_corr(ts_delay(fnd6_newqeventv110_cibegniq, 30), fn_comp_not_rec_stock_options_q, 120)
group_scale(subtract(ts_sum(fnd6_newqeventv110_cibegniq, 60), ts_sum(fn_comp_not_rec_stock_options_q, 60)), 'country')
signed_power(ts_delta(fnd6_newqeventv110_cibegniq, 180), 0.5)
ts_arg_max(divide(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_a), 252)
group_backfill(ts_mean(fn_comp_not_rec_stock_options_q, 90), 'sector', 60)
normalize(multiply(ts_regression(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_a, 120, 0, 0), 100), true)
winsorize(ts_std_dev(subtract(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_stock_options_q), 180), 3)
ts_quantile(ts_delta(fnd6_newqeventv110_cibegniq, 90), 180, 'uniform')
bucket(rank(ts_mean(fn_comp_not_rec_a, 120)), buckets="2,5,6,7,10")
ts_backfill(ts_arg_min(fnd6_newqeventv110_cibegniq, 90), 120, 1, "NAN")
invert(ts_rank(multiply(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_stock_options_q), 180))
group_mean(ts_zscore(fnd6_newqeventv110_cibegniq, 90), 'industry', 'sector')
ts_scale(subtract(fnd6_newqeventv110_cibegniq, fn_comp_not_rec_a), 252, 0)

@ -0,0 +1,39 @@
add(ts_rank(fn_comp_not_rec_stock_options_q, 18), ts_zscore(fnd6_spce, 18))
subtract(ts_mean(fnd6_newqeventv110_spceepsq, 18), ts_std_dev(fnd6_newqeventv110_spceepsq, 18))
multiply(ts_delta(fnd6_newqeventv110_spcedq, 18), ts_rank(fnd6_newqeventv110_glceaq, 18))
divide(ts_sum(fnd6_newqv1300_spcedq, 18), ts_sum(fnd6_newqeventv110_spceeps12, 18))
if_else(ts_zscore(fnd6_newqeventv110_spcepd12, 18) > 0, ts_mean(fnd6_newqv1300_spceepsq, 18), ts_delta(fnd6_newqeventv110_spceepsq, 18))
ts_av_diff(fnd6_newqeventv110_spcep12, 18)
power(ts_corr(fnd6_spce, fn_comp_not_rec_stock_options_a, 18), 2)
reverse(ts_rank(fn_comp_not_rec_stock_options_q, 18))
ts_regression(fnd6_newqeventv110_spceepsq, fnd6_newqeventv110_glceaq, 18, 0, 0)
group_neutralize(ts_mean(fnd6_newqeventv110_spcedq, 18), fnd6_newqeventv110_spcedq)
max(ts_delay(fnd6_spce, 18), ts_mean(fnd6_spce, 18))
min(ts_sum(fnd6_newqeventv110_spceeps12, 18), ts_product(fnd6_newqeventv110_spceepsq, 18))
ts_scale(fnd6_newqv1300_spceepsq, 18, 1)
signed_power(ts_delta(fn_comp_not_rec_stock_options_a, 18), 0.5)
log(ts_sum(fnd6_newqeventv110_spcep12, 18))
sqrt(ts_mean(fnd6_newqeventv110_glceaq, 18))
inverse(ts_std_dev(fnd6_newqeventv110_spcepd12, 18))
ts_decay_linear(fnd6_newqeventv110_spceepsq, 18, false)
ts_backfill(fnd6_newqv1300_spcedq, 18, 1, "NAN")
hump(ts_zscore(fnd6_newqeventv110_spceeps12, 18), 0.01)

@ -0,0 +1,39 @@
ts_zscore(fnd6_newqeventv110_spceepsq, 180)
group_neutralize(ts_delta(fnd6_newqeventv110_spcedq, 60), 'industry')
ts_rank(fnd6_newqv1300_spceepsq, 120) * ts_std_dev(fnd6_spce, 90)
ts_scale(fnd6_newqeventv110_spceeps12, 180, 0.5)
ts_corr(fnd6_newqeventv110_spcedq, fnd6_spce, 120)
group_zscore(ts_av_diff(fnd6_newqeventv110_spceepsq, 90), 'sector')
ts_decay_linear(fnd6_newqv1300_spcedq, 60, false)
ts_quantile(fnd6_newqeventv110_spcepd12, 180, 'uniform')
ts_rank(fnd6_newqeventv110_spcep12, 90) - ts_rank(fnd6_spce, 90)
group_mean(fnd6_newqeventv110_spceepsq, fnd6_spce, 'industry')
ts_delta(ts_mean(fnd6_newqv1300_spcedq, 30), 60)
ts_zscore(ts_delta(fnd6_spce, 30), 90)
ts_regression(fnd6_newqeventv110_spceepsq, fnd6_spce, 120, 0, 1)
group_scale(ts_std_dev(fnd6_newqeventv110_spcedq, 60), 'subindustry')
ts_arg_max(fnd6_newqeventv110_spceeps12, 180)
ts_backfill(fnd6_newqv1300_spceepsq, 120, 2, 'NAN')
ts_product(ts_delta(fnd6_spce, 30), 60)
ts_count_nans(fnd6_newqeventv110_spcepd12, 90)
group_rank(ts_zscore(fnd6_newqeventv110_spcedq, 60), 'country')
ts_covariance(fnd6_newqeventv110_spceepsq, fnd6_spce, 90)

@ -0,0 +1,39 @@
group_neutralize(ts_delta(multiply(divide(fnd6_newqeventv110_spceepsq, ts_delay(fnd6_newqeventv110_spceepsq, 90)), ts_rank(sales_ps, 120)), 'sector'), 'sector')
winsorize(subtract(ts_zscore(divide(sales_ps, ts_delay(sales_ps, 60)), 20), ts_zscore(rp_nip_ratings, 20)), 3)
ts_rank(multiply(ts_delta(fnd6_newqeventv110_spceepsq, 60), sign(ts_delta(nws18_sse, 5))), 120)
if_else(ts_delta(nws18_sse, 10) > 0, ts_sum(divide(fnd6_newqeventv110_spceepsq, sales_ps), 60), ts_delta(sales_ps, 60))
group_zscore(ts_mean(multiply(ts_delta(fnd6_spce, 30), ts_rank(nws18_sse, 60)), 90), 'industry')
quantile(add(ts_regression(sales_ps, fnd6_newqeventv110_spceepsq, 90, 0, 0), ts_corr(sales_ps, nws18_sse, 30)))
scale(ts_av_diff(divide(fnd6_newqeventv110_spceepsq, ts_delay(fnd6_newqeventv110_spceepsq, 90)), 60))
ts_sum(multiply(sign(ts_delta(fnd6_newqeventv110_spceepsq, 30)), ts_rank(rp_nip_ratings, 60)), 90)
rank(ts_backfill(multiply(ts_delta(sales_ps, 30), ts_zscore(nws18_sse, 30))))
multiply(ts_scale(divide(fnd6_newqeventv110_spceepsq, sales_ps), 60), ts_rank(ts_delta(nws18_sse, 10), 30))
hump(subtract(ts_zscore(fnd6_newqeventv110_spceepsq, 60), ts_zscore(sales_ps, 60)), 0.01)
ts_decay_linear(multiply(ts_delta(fnd6_newqeventv110_spceepsq, 30), abs(ts_delta(nws18_sse, 5))), 60, false)
if_else(ts_delta(rp_nip_ratings, 10) > ts_mean(rp_nip_ratings, 30), ts_sum(fnd6_newqeventv110_spceepsq, 60), reverse(ts_sum(sales_ps, 60)))
group_mean(divide(ts_delta(fnd6_spce, 30), ts_std_dev(sales_ps, 30)), 'equal', 'sector')
ts_covariance(divide(fnd6_newqeventv110_spceepsq, sales_ps), nws18_sse, 60)
power(ts_sum(sign(ts_delta(fnd6_newqeventv110_spceepsq, 20)), 60), ts_rank(ts_delta(nws18_sse, 10), 30))
kth_element(multiply(ts_delta(sales_ps, 30), ts_rank(rp_nip_ratings, 60), 90), 60, 1)
add(ts_product(divide(fnd6_newqeventv110_spceepsq, ts_delay(fnd6_newqeventv110_spceepsq, 30)), 60), ts_count_nans(nws18_sse, 60))
multiply(ts_arg_max(fnd6_newqeventv110_spceepsq, 60), ts_arg_min(sales_ps, 60))
subtract(ts_quantile(divide(fnd6_newqeventv110_spceepsq, sales_ps), 90, 'gaussian'), ts_quantile(nws18_sse, 90, 'uniform'))

@ -0,0 +1,39 @@
ts_rank(ts_delta(fnd6_newqeventv110_spceepsq, 63), 252)
ts_scale(ts_sum(fnd6_newqv1300_spceepsq, 90), 90)
group_neutralize(ts_zscore(fnd6_newqeventv110_spcedq, 126), 'sector')
ts_mean(ts_delta(fnd6_spce, 21), 63)
ts_corr(fnd6_newqv1300_spceepsq, sales_ps, 126)
ts_rank(ts_delta(ts_mean(fnd6_spce, 63), 21), 252)
ts_decay_linear(fnd6_newqeventv110_spceepsq, 63, true)
ts_regression(fnd6_newqeventv110_spceepsq, sales_ps, 126, 0, 0)
ts_std_dev(ts_delta(fnd6_newqv1300_spceepsq, 21), 126)
ts_product(ts_av_diff(fnd6_spce, 90), 21)
ts_quantile(ts_delta(fnd6_newqeventv110_spcedq, 63), 126, "uniform")
rank(ts_zscore(ts_sum(fnd6_spce, 63), 126))
ts_arg_max(ts_delta(fnd6_newqv1300_spceepsq, 21), 252)
group_rank(ts_mean(fnd6_newqeventv110_spceepsq, 63), 'industry')
ts_backfill(ts_delta(fnd6_spce, 63), 63, 1, "NAN")
ts_count_nans(ts_delta(fnd6_newqeventv110_spcedq, 21), 126)
ts_covariance(fnd6_newqv1300_spceepsq, sales_ps, 126)
ts_step(1) * ts_delta(fnd6_newqeventv110_spceepsq, 63)
normalize(ts_rank(ts_sum(fnd6_spce, 90), 252), true)
group_zscore(ts_delta(fnd6_newqv1300_spceepsq, 21), 'subindustry')

@ -0,0 +1,39 @@
divide(subtract(fnd6_cicurr, fn_comp_not_rec_a), ts_mean(fn_def_tax_assets_liab_net_q, 63))
not(ts_delta(fnd6_a_ltrmdmrepopliny5, 42))
ts_rank(multiply(fn_comp_not_rec_stock_options_q, forward_price_120), 126)
group_neutralize(ts_zscore(fnd6_newqv1300_ciderglq, 84), bucket(ts_step(1)))
power(add(fnd6_acdo, fnd6_newqeventv110_cicurrq, true), ts_av_diff(fn_comp_not_rec_stock_options_a, 21))
if_else(fnd6_newqv1300_cicurrq > vec_avg(fnd6_cicurr), ts_sum(fn_comp_not_rec_a, 63), reverse(ts_rank(fnd6_a_ltrmdmrepopliny5, 84)))
ts_corr(fnd6_cicurr, multi_factor_acceleration_score_derivative, 252)
kth_element(fn_def_tax_assets_liab_net_q, 21, 5)
scale(ts_backfill(fnd6_newqv1300_cicurrq, 42, 3), 2, 1, 1)
group_zscore(ts_delta(fn_comp_not_rec_stock_options_q, 63), bucket(ts_step(1), range="0,1,0.2"))
signed_power(ts_mean(fnd6_acdo, 126), ts_std_dev(fnd6_newqeventv110_cicurrq, 84))
subtract(ts_arg_max(fn_comp_not_rec_stock_options_a, 63), ts_arg_min(fn_def_tax_assets_liab_net_q, 63))
divide(ts_count_nans(fnd6_newqv1300_ciderglq, 126), ts_product(fnd6_a_ltrmdmrepopliny5, 42))
ts_regression(forward_price_120, multi_factor_acceleration_score_derivative, 252, 5, 1)
hump(rank(fnd6_cicurr, 0), 0.05)
vec_sum(ts_decay_linear(fn_comp_not_rec_a, 21, true))
group_rank(ts_scale(fnd6_newqv1300_cicurrq, 84, 0.1), densify(bucket(ts_step(1), buckets="2,5,10")))
days_from_last_change(fn_comp_not_rec_stock_options_q)
winsorize(ts_covariance(fnd6_acdo, fnd6_newqeventv110_cicurrq, 126), 3)
normalize(ts_quantile(fn_def_tax_assets_liab_net_q, 63, "uniform"), true, 0.1)

@ -0,0 +1,39 @@
ts_delta(divide(subtract(fnd6_acdo, fnd6_cicurr), ts_mean(fn_comp_not_rec_a, 64)), 32)
divide(subtract(fn_def_tax_assets_liab_net_q, ts_delay(fn_def_tax_assets_liab_net_q, 32)), kth_element(fn_comp_not_rec_stock_options_q, 64, 1))
sign(subtract(kth_element(fnd6_newqv1300_cicurrq, 64, 2), ts_sum(fn_comp_not_rec_stock_options_a, 32)))
ts_scale(power(divide(fnd6_newqv1300_ciderglq, fn_comp_not_rec_a), signed_power(log(fn_comp_not_rec_stock_options_q), 2)), 64)
reverse(ts_rank(divide(subtract(fnd6_acdo, fn_def_tax_assets_liab_net_q), ts_sum(fn_comp_not_rec_stock_options_q, 32)), 64))
inverse(ts_mean(subtract(ts_delta(fn_comp_not_rec_a, 16), fnd6_newqv1300_cicurrq), 32))
abs(ts_zscore(divide(fn_def_tax_assets_liab_net_q, ts_product(fn_comp_not_rec_stock_options_q, 32)), 32))
ts_backfill(divide(ts_sum(fnd6_acdo, 16), subtract(kth_element(fn_comp_not_rec_stock_options_a, 32, 1), fnd6_newqv1300_ciderglq)), 32, 1, "NAN")
ts_arg_max(sign(subtract(ts_mean(fn_comp_not_rec_a, 16), fnd6_newqv1300_cicurrq)), 32)
ts_arg_min(power(divide(fn_def_tax_assets_liab_net_q, abs(fn_comp_not_rec_stock_options_q)), 2), 32)
divide(last_diff_value(ts_av_diff(fn_comp_not_rec_a, 32), 32), ts_std_dev(fn_comp_not_rec_stock_options_q, 32))
days_from_last_change(ts_regression(fn_def_tax_assets_liab_net_q, fnd6_acdo, 32, 0, 0))
ts_corr(subtract(ts_sum(fn_comp_not_rec_stock_options_a, 16), fnd6_newqv1300_ciderglq), fnd6_newqv1300_cicurrq, 32)
ts_covariance(fn_comp_not_rec_a, ts_delay(divide(fn_def_tax_assets_liab_net_q, fnd6_acdo), 16), 32)
ts_count_nans(if_else(fn_comp_not_rec_stock_options_q > fnd6_newqv1300_cicurrq, log(fn_comp_not_rec_stock_options_a), fn_def_tax_assets_liab_net_q), 32)
ts_decay_linear(add(fn_comp_not_rec_a, ts_delta(fn_def_tax_assets_liab_net_q, 8), true), 32, false)
ts_quantile(hump(divide(reverse(fn_comp_not_rec_stock_options_q), ts_mean(fnd6_acdo, 16)), 0.01), 32, "gaussian")
ts_rank(if_else(fn_def_tax_assets_liab_net_q <= fnd6_newqv1300_ciderglq, ts_zscore(fn_comp_not_rec_stock_options_a, 16), forward_price_120), 64, 0.1)
ts_sum(min(add(fn_comp_not_rec_a, fnd6_newqv1300_cicurrq, true), max(fn_def_tax_assets_liab_net_q, fn_comp_not_rec_stock_options_q), ts_product(fnd6_acdo, 4)), 32)
ts_step(multiply(sign(subtract(fn_comp_not_rec_stock_options_a, ts_delay(fnd6_newqv1300_ciderglq, 8))), and(not(is_nan(fn_def_tax_assets_liab_net_q)), fnd6_acdo == fnd6_newqv1300_cicurrq), true))

@ -0,0 +1,39 @@
ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2)
ts_rank(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 252)
group_rank(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), fn_comp_not_rec_a)
group_zscore(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), fn_comp_not_rec_stock_options_q)
ts_zscore(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 60)
ts_std_dev(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 60)
reverse(ts_corr(ts_delta(fnd6_cicurr, 2), ts_delta(fnd6_acdo, 2), 60))
ts_av_diff(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 252)
group_neutralize(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), fn_def_tax_assets_liab_net_q)
ts_quantile(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 252, "uniform")
winsorize(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 3)
ts_regression(fnd6_cicurr, fnd6_acdo, 60, 0, 1)
rank(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2))
ts_scale(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 252)
group_scale(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), fn_comp_not_rec_stock_options_a)
multiply(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), ts_rank(fnd6_newqv1300_ciderglq, 252))
ts_sum(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 20)
ts_decay_linear(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 60)
ts_count_nans(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 60)
ts_arg_min(ts_delta(divide(subtract(fnd6_cicurr, fnd6_acdo), ts_mean(fnd6_newqeventv110_cicurrq, 4)), 2), 120)

@ -21,7 +21,7 @@ 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',
'deepseek-ai/DeepSeek-V3.2-Exp',
'Qwen/Qwen3-VL-235B-A22B-Instruct',
# 'MiniMaxAI/MiniMax-M2',
# 'zai-org/GLM-4.6',
@ -49,6 +49,8 @@ def process_text(text):
if should_include:
results.append(tl)
results = [item for item in results if item != '"']
if results:
return list(set(results))
else:
@ -96,10 +98,9 @@ def csvFileLoader(file_path, keys_text):
# 如果id不存在,或者想要保留第一个出现的记录
if item_id not in data_dict:
data_dict[item_id] = {
'id': item_id,
'data_set_name': row[1],
'description': row[2],
'description_cn': row[11],
'data_set_name': f"可以使用:{row[1]}",
'description': f"不可使用,仅供参考:{row[2]}",
# 'description_cn': row[11],
}
# 将字典的值转换为列表
@ -175,11 +176,11 @@ def call_siliconflow(prompt, model):
exit(1)
def save_result(result, folder):
def save_result(result, folder, model_name):
now = datetime.now()
time_filename = now.strftime("%H%M%S")
filename = f"{time_filename}.txt"
filename = f"{model_name}_{time_filename}.txt"
filepath = os.path.join(folder, filename)
with open(filepath, 'w', encoding='utf-8') as f:
@ -236,7 +237,8 @@ def call_ai(prompt, model):
if result:
print(f"AI回复: {result[:200]}...")
save_result(result, folder)
model_name = model.replace("/", "_")
save_result(result, folder, model_name)
used_balance = balance - get_user_info()
print(f'本次调用 api 使用额度 {used_balance}')
else:

@ -0,0 +1,174 @@
任务指令
创新成本传导效率
[[假设]]
在通胀上行周期中,能够将原材料成本上涨压力有效向下游传导的公司通常具备更强的定价权与盈利韧性。这类公司在行业中往往占据优势竞争地位,其股价表现相对更具防御性甚至能实现超额收益。相反,成本传导能力弱的公司利润空间易受挤压,股价承压风险较大。
[[实施方案]]
采用“营业成本”与“营业收入”的季度同比变化率数据构建成本传导效率指标。具体计算方式为:(营业收入同比增速 - 营业成本同比增速)。当该差值扩大时,表明公司成本传导能力增强,赋予正权重;差值缩小时则赋予负权重。使用时序回填算子处理数据延迟,并通过横截面z-score标准化进行跨行业初步可比处理。
[[阿尔法因子优化建议]]
考虑到不同行业固有的成本结构及定价模式差异巨大(如制造业vs软件业),建议实施两步中性化:首先,基于行业分类对原始效率指标进行行业均值调整;其次,在行业内部分组中,再根据企业规模(如总资产)进行二次调整,以剥离规模效应的影响,更纯粹地捕捉定价能力差异。
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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字段后面的内容是中文使用说明(不能使用)
{'id': '473', 'data_set_name': 'fnd6_newqeventv110_cibegniq', 'description': 'Comp Inc - Beginning Net Income', 'description_cn': 'comp_inc_beginning_net_income'}
{'id': '2354', 'data_set_name': 'fn_comp_not_rec_a', 'description': 'Unrecognized cost of unvested share-based compensation awards.', 'description_cn': '未兑现股份薪酬 award 的 unrecognized cost'}
{'id': '2356', 'data_set_name': 'fn_comp_not_rec_stock_options_a', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'id': '2357', 'data_set_name': 'fn_comp_not_rec_stock_options_q', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'id': '2436', 'data_set_name': 'fn_liab_fair_val_a', 'description': 'Liabilities Fair Value, Recurring, Total', 'description_cn': '看涨期权负债公允价值_ recurring_total'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -0,0 +1,177 @@
任务指令
供应链韧性与盈利质量联动
[[假设]]供应链韧性强(如供应商分散度合理、核心原材料库存周转稳定、供应链中断风险低)的公司,在行业波动或外部冲击下更能维持生产经营连续性,盈利稳定性与可持续性更优,长期可获得超额收益,建议对这类公司建立多头仓位;反之,供应链脆弱(供应商集中度高、库存周转紊乱、中断风险高)的公司,盈利波动风险大,建议建立空头仓位。
[[实施方案]]分析供应链相关核心指标的时序变化趋势,筛选过去 18 个月供应商分散度处于合理区间、核心原材料库存周转率波动幅度低于阈值、供应链中断预警信号为阴性的公司,构建多头组合;同时筛选供应商集中度持续攀升、库存周转率大幅波动、出现供应链中断预警信号的公司,构建空头组合,通过时序算子捕捉指标趋势变化,规避短期噪音干扰。
[[阿尔法因子优化建议]]不同行业供应链结构差异显著(如制造业与服务业供应链依赖度不同),采用行业中性化处理能否提升策略适配性?此外,供应链韧性与盈利质量的关联性可能受宏观环境(如物流成本、贸易政策)影响,引入宏观因子调节算子,动态调整因子权重,是否可增强策略抗周期能力?
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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字段后面的内容是中文使用说明(不能使用)
{'id': '517', 'data_set_name': 'fnd6_newqeventv110_glceaq', 'description': 'Gain/Loss on Sale (Core Earnings Adjusted) After-tax', 'description_cn': '税后核心 earnings 润亏'}
{'id': '624', 'data_set_name': 'fnd6_newqeventv110_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': 'SPCE earnings per share diluted'}
{'id': '625', 'data_set_name': 'fnd6_newqeventv110_spceeps12', 'description': 'S&P Core Earnings EPS Basic 12MM', 'description_cn': '标普核心 earnings 每股基本值_12M'}
{'id': '628', 'data_set_name': 'fnd6_newqeventv110_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings 每股基本值'}
{'id': '629', 'data_set_name': 'fnd6_newqeventv110_spcep12', 'description': 'S&P Core Earnings 12MM - Preliminary', 'description_cn': '标普核心 earnings 12个月 - 预liminary'}
{'id': '630', 'data_set_name': 'fnd6_newqeventv110_spcepd12', 'description': 'S&P Core Earnings 12MM EPS Diluted - Preliminary', 'description_cn': 'S&P核心 earnings_12个月稀释后每股盈亏平衡点_初步'}
{'id': '774', 'data_set_name': 'fnd6_newqv1300_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': '标准普尔核心 earnings 每股稀释后利润'}
{'id': '777', 'data_set_name': 'fnd6_newqv1300_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings EPS 基本'}
{'id': '872', 'data_set_name': 'fnd6_spce', 'description': 'S&P Core Earnings', 'description_cn': '标准普尔核心 earnings'}
{'id': '2356', 'data_set_name': 'fn_comp_not_rec_stock_options_a', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'id': '2357', 'data_set_name': 'fn_comp_not_rec_stock_options_q', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -0,0 +1,185 @@
任务指令
客户生命周期价值动量
[[假设]]
订阅制或高复购率行业(如SaaS、消费会员)中,客户生命周期价值(LTV)的加速增长或衰减,领先于营收变化。LTV增长动能强的公司,其未来现金流稳定性更高,应享有估值溢价;动能衰减则预示基本面临顶。
[[实施方案]]
基于客户新增数量、流失率、客单价等字段,通过ts_growth算子计算LTV的季度环比增长率。使用时序动量算子(如ts_rank对过去4个季度的增长率进行排序),对动量处于持续上升通道的公司建立多头仓位。采用行业中性化处理,仅在细分赛道(如企业级SaaS)内进行横截面比较。
[[阿尔法因子优化建议]]
为降低噪声,可结合财报电话会文本分析,提取管理层对“客户健康度”“留存趋势”的定性评论,构建情绪调整因子。当量化LTV动量与文本情绪一致时,增强信号权重;当背离时,降低权重或屏蔽信号。
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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字段后面的内容是中文使用说明(不能使用)
{'id': '517', 'data_set_name': 'fnd6_newqeventv110_glceaq', 'description': 'Gain/Loss on Sale (Core Earnings Adjusted) After-tax', 'description_cn': '税后核心 earnings 润亏'}
{'id': '624', 'data_set_name': 'fnd6_newqeventv110_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': 'SPCE earnings per share diluted'}
{'id': '625', 'data_set_name': 'fnd6_newqeventv110_spceeps12', 'description': 'S&P Core Earnings EPS Basic 12MM', 'description_cn': '标普核心 earnings 每股基本值_12M'}
{'id': '628', 'data_set_name': 'fnd6_newqeventv110_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings 每股基本值'}
{'id': '629', 'data_set_name': 'fnd6_newqeventv110_spcep12', 'description': 'S&P Core Earnings 12MM - Preliminary', 'description_cn': '标普核心 earnings 12个月 - 预liminary'}
{'id': '630', 'data_set_name': 'fnd6_newqeventv110_spcepd12', 'description': 'S&P Core Earnings 12MM EPS Diluted - Preliminary', 'description_cn': 'S&P核心 earnings_12个月稀释后每股盈亏平衡点_初步'}
{'id': '774', 'data_set_name': 'fnd6_newqv1300_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': '标准普尔核心 earnings 每股稀释后利润'}
{'id': '777', 'data_set_name': 'fnd6_newqv1300_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings EPS 基本'}
{'id': '872', 'data_set_name': 'fnd6_spce', 'description': 'S&P Core Earnings', 'description_cn': '标准普尔核心 earnings'}
{'id': '958', 'data_set_name': 'sales_ps', 'description': 'Sales per Share (Quarterly)', 'description_cn': '每-share销售(季度)'}
{'id': '1000', 'data_set_name': 'multi_factor_acceleration_score_derivative', 'description': 'Change in the acceleration of multi-factor score compared to previous period.', 'description_cn': '多因子评分加速度变化 Compared_to_Previous_Period_Multi_Factor_Score_Acceleration_Change'}
{'id': '2248', 'data_set_name': 'nws18_sse', 'description': 'Sentiment of phrases impacting the company', 'description_cn': '公司情绪影响短语_sentiment'}
{'id': '2306', 'data_set_name': 'rp_nip_ratings', 'description': 'News impact projection of analyst ratings-related news', 'description_cn': '分析师评级相关新闻的/news_impact_projection'}
{'id': '2356', 'data_set_name': 'fn_comp_not_rec_stock_options_a', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'id': '2357', 'data_set_name': 'fn_comp_not_rec_stock_options_q', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'id': '2501', '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.', 'description_cn': 'treasury_repossession_shares_num'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -0,0 +1,196 @@
任务指令
ESG 表现与盈余质量联动因子
假设高 ESG(环境、社会、治理)表现的公司通常具备更完善的内部治理体系和风险管控能力,盈余管理动机较弱,盈余质量(如盈利真实性、持续性)更高,长期股价表现更稳健,适合建立多头仓位;反之,低 ESG 表现的公司易因治理缺陷、合规风险导致盈余质量低下,盈利稳定性差,应建立空头仓位。且 ESG 表现的边际改善对盈余质量的提升效应,比静态高 ESG 表现更具 alpha 收益潜力。
实施方案以 ESG 综合评分及各维度(治理、社会、环境)评分作为核心变量,搭配盈余质量指标(如应计利润比率、盈利现金保障倍数)构建联动因子。通过时序分析算子追踪过去 12 个月 ESG 评分的变化趋势与盈余质量指标的匹配度,对 ESG 评分持续提升且盈余质量同步改善的公司纳入多头池,对 ESG 评分下滑且盈余质量恶化的公司纳入空头池,同时消除企业规模及行业周期对指标的干扰。
阿尔法因子优化建议
可将 ESG 各维度拆分单独与盈余质量联动,筛选出对盈余质量影响最显著的核心维度(如治理维度)强化权重,弱化非核心维度干扰;2. 采用行业中性化处理方案,消除不同行业 ESG 评价标准差异及盈余质量基准不同带来的偏差,可结合分组算子对同类行业公司进行横向对比;3. 引入动态阈值机制,基于市场整体 ESG 水平及盈余质量分布,实时调整多空仓位的筛选标准,避免静态标准在市场周期切换时失效。
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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字段后面的内容是中文使用说明(不能使用)
{'id': '125', 'data_set_name': 'fnd6_cisecgl', 'description': 'Comp Inc - Securities Gains/Losses', 'description_cn': '-comp_inc_securities_gains_losses'}
{'id': '239', 'data_set_name': 'fnd6_eventv110_gdwlidq', 'description': 'Impairment of Goodwill Diluted EPS Effect', 'description_cn': 'goodwill损耗后稀释每股收益影响'}
{'id': '240', 'data_set_name': 'fnd6_eventv110_gdwlieps12', 'description': 'Impairment of Goodwill Basic EPS Effect 12MM', 'description_cn': 'goodwill_impairment_basic_eps_effect_12m'}
{'id': '241', 'data_set_name': 'fnd6_eventv110_gdwliepsq', 'description': 'Impairment of Goodwill Basic EPS Effect', 'description_cn': 'goodwill impairment basic_eps_effect'}
{'id': '413', 'data_set_name': 'fnd6_newa2v1300_oiadp', 'description': 'Operating Income After Depreciation', 'description_cn': '营业净利润 after depreciation 不变,无需翻译。请提供需要翻译的专业字段名。'}
{'id': '473', 'data_set_name': 'fnd6_newqeventv110_cibegniq', 'description': 'Comp Inc - Beginning Net Income', 'description_cn': 'comp_inc_beginning_net_income'}
{'id': '510', 'data_set_name': 'fnd6_newqeventv110_gdwlamq', 'description': 'Amortization of Goodwill', 'description_cn': 'goodwill摊销'}
{'id': '511', 'data_set_name': 'fnd6_newqeventv110_gdwlia12', 'description': 'Impairments of Goodwill After-Tax - 12MM', 'description_cn': 'goodwill_减值税后_12M'}
{'id': '512', 'data_set_name': 'fnd6_newqeventv110_gdwliaq', 'description': 'Impairment of Goodwill After-tax', 'description_cn': 'goodwill_ impairment_after_tax'}
{'id': '513', 'data_set_name': 'fnd6_newqeventv110_gdwlipq', 'description': 'Impairment of Goodwill Pretax', 'description_cn': 'goodwill impairment pretax'}
{'id': '517', 'data_set_name': 'fnd6_newqeventv110_glceaq', 'description': 'Gain/Loss on Sale (Core Earnings Adjusted) After-tax', 'description_cn': '税后核心 earnings 润亏'}
{'id': '624', 'data_set_name': 'fnd6_newqeventv110_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': 'SPCE earnings per share diluted'}
{'id': '625', 'data_set_name': 'fnd6_newqeventv110_spceeps12', 'description': 'S&P Core Earnings EPS Basic 12MM', 'description_cn': '标普核心 earnings 每股基本值_12M'}
{'id': '628', 'data_set_name': 'fnd6_newqeventv110_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings 每股基本值'}
{'id': '629', 'data_set_name': 'fnd6_newqeventv110_spcep12', 'description': 'S&P Core Earnings 12MM - Preliminary', 'description_cn': '标普核心 earnings 12个月 - 预liminary'}
{'id': '630', 'data_set_name': 'fnd6_newqeventv110_spcepd12', 'description': 'S&P Core Earnings 12MM EPS Diluted - Preliminary', 'description_cn': 'S&P核心 earnings_12个月稀释后每股盈亏平衡点_初步'}
{'id': '688', 'data_set_name': 'fnd6_newqv1300_ciderglq', 'description': 'Comp Inc - Derivative Gains/Losses', 'description_cn': '-comp_inc_derivative_gains_losses'}
{'id': '704', 'data_set_name': 'fnd6_newqv1300_dilavq', 'description': 'Dilution Available - Excluding Extraordinary Items', 'description_cn': '稀释潜力(非 extraordinay 项目)'}
{'id': '774', 'data_set_name': 'fnd6_newqv1300_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': '标准普尔核心 earnings 每股稀释后利润'}
{'id': '777', 'data_set_name': 'fnd6_newqv1300_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings EPS 基本'}
{'id': '872', 'data_set_name': 'fnd6_spce', 'description': 'S&P Core Earnings', 'description_cn': '标准普尔核心 earnings'}
{'id': '936', 'data_set_name': 'goodwill', 'description': 'Goodwill (net)', 'description_cn': 'goodwill_净额'}
{'id': '989', '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.', 'description_cn': '最终得分M-_score=五角大楼表面评分与五角加速评分加权平均值'}
{'id': '1000', 'data_set_name': 'multi_factor_acceleration_score_derivative', 'description': 'Change in the acceleration of multi-factor score compared to previous period.', 'description_cn': '多因子评分加速度变化 Compared_to_Previous_Period_Multi_Factor_Score_Acceleration_Change'}
{'id': '1397', 'data_set_name': 'anl4_totgw_high', 'description': 'Total Goodwill - The highest estimation', 'description_cn': '总 goodwill - 最高估计值'}
{'id': '1400', 'data_set_name': 'anl4_totgw_median', 'description': 'Total Goodwill - median of estimations', 'description_cn': '总 goodwill - 估计值中位数'}
{'id': '1672', 'data_set_name': 'total_goodwill_amount', 'description': 'Total Goodwill - Value', 'description_cn': '总 goodwill - 值'}
{'id': '2354', 'data_set_name': 'fn_comp_not_rec_a', 'description': 'Unrecognized cost of unvested share-based compensation awards.', 'description_cn': '未兑现股份薪酬 award 的 unrecognized cost'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -0,0 +1,191 @@
任务指令
投资者情绪与现金流错配效应
假设
当公司现金流表现强劲但投资者情绪持续低迷时,市场可能低估其真实价值,形成潜在的股价修复机会;反之,若投资者情绪高涨而现金流表现疲弱,则股价可能存在下行风险。
实施方案
结合现金流数据字段与投资者情绪指标(如网络搜索热度、新闻情感指数),构建现金流增长率与情绪指标的时序差值序列。当差值超过阈值时,建立多头仓位;当差值低于负阈值时,建立空头仓位。
阿尔法因子优化建议
可引入行业相对情绪调整因子,通过横截面标准化消除行业情绪周期性波动的影响,增强选股信号的纯净度。
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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_eventv110_gdwlieps12', 'description': 'Impairment of Goodwill Basic EPS Effect 12MM', 'description_cn': 'goodwill_impairment_basic_eps_effect_12m'}
{'data_set_name': 'fnd6_eventv110_gdwliepsq', 'description': 'Impairment of Goodwill Basic EPS Effect', 'description_cn': 'goodwill impairment basic_eps_effect'}
{'data_set_name': 'fnd6_newqeventv110_cibegniq', 'description': 'Comp Inc - Beginning Net Income', 'description_cn': 'comp_inc_beginning_net_income'}
{'data_set_name': 'fnd6_newqeventv110_glceaq', 'description': 'Gain/Loss on Sale (Core Earnings Adjusted) After-tax', 'description_cn': '税后核心 earnings 润亏'}
{'data_set_name': 'fnd6_newqeventv110_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': 'SPCE earnings per share diluted'}
{'data_set_name': 'fnd6_newqeventv110_spceeps12', 'description': 'S&P Core Earnings EPS Basic 12MM', 'description_cn': '标普核心 earnings 每股基本值_12M'}
{'data_set_name': 'fnd6_newqeventv110_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings 每股基本值'}
{'data_set_name': 'fnd6_newqeventv110_spcep12', 'description': 'S&P Core Earnings 12MM - Preliminary', 'description_cn': '标普核心 earnings 12个月 - 预liminary'}
{'data_set_name': 'fnd6_newqeventv110_spcepd12', 'description': 'S&P Core Earnings 12MM EPS Diluted - Preliminary', 'description_cn': 'S&P核心 earnings_12个月稀释后每股盈亏平衡点_初步'}
{'data_set_name': 'fnd6_newqv1300_cipenq', 'description': 'Comp Inc - Minimum Pension Adj', 'description_cn': '-comp_inc_min_pension_adj'}
{'data_set_name': 'fnd6_newqv1300_spcedq', 'description': 'S&P Core Earnings EPS Diluted', 'description_cn': '标准普尔核心 earnings 每股稀释后利润'}
{'data_set_name': 'fnd6_newqv1300_spceepsq', 'description': 'S&P Core Earnings EPS Basic', 'description_cn': '标普核心 earnings EPS 基本'}
{'data_set_name': 'fnd6_spce', 'description': 'S&P Core Earnings', 'description_cn': '标准普尔核心 earnings'}
{'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.', 'description_cn': '最终得分M-Score是pentagon表面分数和pentagon加速度分数的加权平均值。'}
{'data_set_name': 'multi_factor_acceleration_score_derivative', 'description': 'Change in the acceleration of multi-factor score compared to previous period.', 'description_cn': '多因子评分加速度变化 Compared_to_Previous_Period_Multi_Factor_Score_Acceleration_Change'}
{'data_set_name': 'anl4_netdebt_flag', 'description': 'Net debt - forecast type (revision/new/...)', 'description_cn': '净负债-预测类型(修正值/新值/....ImageAlign\n<|im_start|>user\nstrike price'}
{'data_set_name': 'news_max_up_amt', 'description': 'The after the news high minus the price at the time of the news', 'description_cn': '新闻后 highs 减去 新闻时 price 的差值'}
{'data_set_name': 'nws18_sse', 'description': 'Sentiment of phrases impacting the company', 'description_cn': '公司情绪影响短语_sentiment'}
{'data_set_name': 'rp_nip_ratings', 'description': 'News impact projection of analyst ratings-related news', 'description_cn': '分析师评级相关新闻的/news_impact_projection'}
{'data_set_name': 'fn_comp_not_rec_stock_options_a', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'data_set_name': 'fn_comp_not_rec_stock_options_q', 'description': 'Unrecognized cost of unvested stock option awards.', 'description_cn': '未行权股票期权 unrecognized_cost_of_unvested_stock_options'}
{'data_set_name': 'fn_def_tax_assets_liab_net_q', 'description': 'Amount, after allocation of valuation allowances and deferred tax liability, of deferred tax asset attributable to deductible differences and carryforwards, without jurisdictional netting.', 'description_cn': '扣除减值准备和递延税负债后,attributable_to_deferred_tax_asset_amount'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -0,0 +1,195 @@
任务指令
气候风险韧性耦合因子
假设
气候相关风险对企业经营的冲击具有明显时滞,且不同公司在缓释能力上存在显著差异。若企业暴露度低且具备较强缓释能力(如供应商多元化、在地化生产、充足的灾害保险与应急预案),则在极端气候事件或相关政策冲击后,其股价表现相对稳健;反之,暴露高且缓释能力弱的企业往往在事件发生后出现更高的波动性和下跌风险。基于历史气候事件与企业缓释能力的组合,构建一个量化因子来捕捉“韧性-暴露耦合”的投资信号。
实施方案
数据组合与构建要点:
暴露Score:衡量企业在地理分布、行业敏感度、供应链集中度、原材料依赖程度等方面的气候暴露水平;可结合极端天气事件密度、区域气候风险指数、行业对气候敏感性的历史Correlation等信号。
缓释Score:衡量企业缓释能力的指标,如供应商多元化程度、在地化生产比例、保险覆盖率、灾害应急资金与预案披露水平、历史灾害恢复速度等。
韦尔斯分解/耦合分数:将暴露Score与缓释Score按权重组合,形成综合的气候韧性分数(越高表示越强的韧性,越低表示越脆弱)。可通过分组算子对相同暴露水平的公司进行缓释能力横截面比较,或通过时序分位数算子观察过去六至十二个月的变化趋势并回填缺失数据。
交易规则设计:
当综合韧性分数处于低位(高暴露、低缓释)时建立空头仓位;当分数处于高位(低暴露、高缓释)时建立多头仓位。
观察窗口:以季度为基本观测单位,事件发生后在8–12周内动态调整权重与敞口,以捕捉缓释效应的滚动效应。
风险控制:设置最低/最高头寸限制、以及波动性或最大回撤约束,避免因单一事件极端化组合。
数据处理与算子思路(可在你现有的数据处理框架中应用):
时序回填算子(ts_backfill)用于修复因事件导致的缺失数据。
横截面分组算子用于同类企业的缓释能力对比与排名。
分布形态转换算子对暴露与缓释分数进行标准化处理,便于跨行业比较。
行业中性化处理:对不同行业的气候暴露特征差异进行中性化,以提升因子稳定性。
情景分组算子:根据不同气候事件强度情景对信号权重进行调整,提升在极端情况下的鲁棒性。
监控与修订:
定期回顾暴露与缓释分数的权重设定,结合宏观气候情景更新参数。
进行滚动回测,评估因子在不同经济周期和地区市场的稳定性与盈利能力。
阿尔法因子优化建议
行业中性化与分组分析:对不可比的行业暴露差异进行中性化处理,按行业分组比较缓释能力与暴露的组合信号。
场景驱动的权重调整:引入极端气候情景(如强降雨洪水、干旱、热浪等)的权重分组,针对不同情景对韧性信号进行动态排序与权重分配。
数据正态化与稳定性:对暴露/缓释分数执行Box-Cox或Z-score等标准化,减少极端值对回测的影响;对因子进行多因子回归的稳健性检验,排除数据分布偏态带来的误导。
跨时间维度的一致性评估:使用滚动相关性与超额收益回归,检验气候韧性因子在不同时间段的稳定性,避免后验过拟合。
组合构建策略:采用分位排序+等权或分层权重分配的方式,避免单点极端信号带来过度换手;结合风险预算模型控制因子暴露。
解释性与透明性:对因子信号进行逐项解释,明确暴露与缓释指标的权重来源,提升策略的可解释性与合规性。
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
必须遵守操作符的使用方法
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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', 'description_cn': '资本支出资产、 plant 和设备计划表 V'}
{'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.', 'description_cn': '最终得分M-_score=五角大楼表面评分与五角加速评分加权平均值'}
{'data_set_name': 'rp_nip_ratings', 'description': 'News impact projection of analyst ratings-related news', 'description_cn': '分析师评级相关新闻的/news_impact_projection'}
{'data_set_name': 'fnd2_a_ltrmdmrepopliny5', 'description': 'Amount of long-term debt payable, sinking fund requirements, and other securities issued that are redeemable by holder at fixed or determinable prices and dates maturing in the 5th 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.', 'description_cn': '长期债务应付金额, sinking fund要求,及其他可由持有者在固定或可确定价格及日期于第5个财政年度内赎回的其他证券,不包括采用滚动期间报告的中间和年度期段从最新资产负债表日期起的期间。'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -0,0 +1,181 @@
任务指令
假设
市场对企业的流动性风险存在阶段性定价偏差。当企业短期融资依赖度上升但经营性现金流未能同步改善时,市场往往低估其潜在的偿债压力与折价抛售资产风险,导致股价在未来1-3个季度内表现疲软。反之,当企业主动降低短期融资依赖、增强经营性现金流与短期债务的匹配度时,其财务稳健性的提升可能未被市场及时充分定价,从而存在超额收益机会。
实施方案
使用“短期有息负债”、“经营性现金流净额”及“货币资金”等基础数据字段,构建核心指标“流动性错配度”(LMD)= (短期有息负债 - 货币资金) / 过去四个季度平均经营性现金流净额。使用时序差分算子(ts_delta)计算LMD在过去两个季度的变化方向与幅度,并结合横截面排名算子(cs_rank)确定其在全市场中的相对位置。对LMD指标显著恶化(排名上升幅度居前)的公司建立空头仓位,对LMD指标持续改善(排名下降幅度居前)的公司建立多头仓位。
阿尔法因子优化建议
该因子信号可能受行业运营资本周期特性干扰。建议采用动态行业分档中性化:首先根据企业历史现金流波动性(使用ts_stddev算子)将其划分为“现金流稳定型”与“现金流周期型”两组,再在各自组内按细分行业进行横截面比较和排名调整。此举可在保留跨行业可比性的同时,更精准地捕捉行业内因流动性管理能力差异而产生的Alpha。
*=========================================================================================*
输出格式:
输出必须是且仅是纯文本。
每一行是一个完整、独立、语法正确的WebSim表达式。
严禁任何形式的解释、编号、标点包裹(如引号)、Markdown格式或额外文本。
===================== !!! 重点(输出方式) !!! =====================
现在,请严格遵守以上所有规则,开始生成可立即在WebSim中运行的复合因子表达式。
**输出格式**(一行一个表达式, 每个表达式中间需要添加一个空行, 只要表达式本身, 不需要赋值, 不要解释, 不需要序号, 也不要输出多余的东西):
表达式
表达式
表达式
...
表达式
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
必须遵守操作符的使用方法
以下是我的账号有权限使用的操作符, 请严格按照操作符, 进行生成,组合因子
========================= 操作符开始 =======================================注意: 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': '可以使用:forward_price_120', 'description': '不可使用,仅供参考:Forward price at 120 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': '可以使用:fnd6_acdo', 'description': '不可使用,仅供参考:Current Assets of Discontinued Operations'}
{'data_set_name': '可以使用:fnd6_cicurr', 'description': '不可使用,仅供参考:Comp Inc - Currency Trans Adj'}
{'data_set_name': '可以使用:fnd6_newqeventv110_cicurrq', 'description': '不可使用,仅供参考:Comp Inc - Currency Trans Adj'}
{'data_set_name': '可以使用:fnd6_newqv1300_cicurrq', 'description': '不可使用,仅供参考:Comp Inc - Currency Trans Adj'}
{'data_set_name': '可以使用:fnd6_newqv1300_ciderglq', 'description': '不可使用,仅供参考:Comp Inc - Derivative Gains/Losses'}
{'data_set_name': '可以使用:multi_factor_acceleration_score_derivative', 'description': '不可使用,仅供参考:Change in the acceleration of multi-factor score compared to previous period.'}
{'data_set_name': '可以使用:fn_comp_not_rec_a', 'description': '不可使用,仅供参考:Unrecognized cost of unvested share-based compensation awards.'}
{'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_assets_liab_net_q', 'description': '不可使用,仅供参考:Amount, after allocation of valuation allowances and deferred tax liability, of deferred tax asset attributable to deductible differences and carryforwards, without jurisdictional netting.'}
{'data_set_name': '可以使用:fnd2_a_ltrmdmrepopliny5', 'description': '不可使用,仅供参考:Amount of long-term debt payable, sinking fund requirements, and other securities issued that are redeemable by holder at fixed or determinable prices and dates maturing in the 5th 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.'}
========================= 数据字段结束 =======================================
以上数据字段和操作符, 按照Description说明组合, 但是每一个 alpha 组合的使用的数据字段和操作符不要过于集中, 在符合语法的情况下, 多尝试不同的组合

@ -1,12 +1,12 @@
任务指令
[[假设]]
客户留存率波动率较低的公司往往体现核心业务的可持续性和抗周期能力,这类企业在市场震荡期间更可能维持稳定的现金流和估值水平,从而在避险情绪升温时获得超额正收益
假设
市场对企业的流动性风险存在阶段性定价偏差。当企业短期融资依赖度上升但经营性现金流未能同步改善时,市场往往低估其潜在的偿债压力与折价抛售资产风险,导致股价在未来1-3个季度内表现疲软。反之,当企业主动降低短期融资依赖、增强经营性现金流与短期债务的匹配度时,其财务稳健性的提升可能未被市场及时充分定价,从而存在超额收益机会
[[实施方案]]
基于企业运营数据,计算客户留存率的滚动波动指标,当该指标连续三个季度低于行业均值时建立多头仓位,反之则建立空头仓位;采用时序标准差算子评估波动趋势,避免对单一数据点的过度反应
实施方案
使用“短期有息负债”、“经营性现金流净额”及“货币资金”等基础数据字段,构建核心指标“流动性错配度”(LMD)= (短期有息负债 - 货币资金) / 过去四个季度平均经营性现金流净额。使用时序差分算子(ts_delta)计算LMD在过去两个季度的变化方向与幅度,并结合横截面排名算子(cs_rank)确定其在全市场中的相对位置。对LMD指标显著恶化(排名上升幅度居前)的公司建立空头仓位,对LMD指标持续改善(排名下降幅度居前)的公司建立多头仓位
[[阿尔法因子优化建议]]
建议引入经济周期分组算子,将样本按复苏/衰退阶段动态切分,并叠加横截面平滑算子以消除短期市场噪音对波动率计算的干扰,这可增强策略在不同宏观环境中的稳健性
阿尔法因子优化建议
该因子信号可能受行业运营资本周期特性干扰。建议采用动态行业分档中性化:首先根据企业历史现金流波动性(使用ts_stddev算子)将其划分为“现金流稳定型”与“现金流周期型”两组,再在各自组内按细分行业进行横截面比较和排名调整。此举可在保留跨行业可比性的同时,更精准地捕捉行业内因流动性管理能力差异而产生的Alpha
*=========================================================================================*
@ -31,4 +31,5 @@
=================================================================
重申:请确保所有表达式都使用WorldQuant WebSim平台函数,不要使用pandas、numpy或其他Python库函数。输出必须是一行有效的WQ表达式。
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
以下是我的账号有权限使用的操作符, 请严格按照操作符, 以及我提供的数据集, 进行生成,组合 20 个alpha:
必须遵守操作符的使用方法

@ -1 +1 @@
["retention", "customer_retention", "client_retention", "customers", "active_customers", "user_retention", "churn", "attrition", "repeat_customers", "loyalty"]
["debt", "cash", "flow", "short", "term", "current", "liabilities", "operating", "interest", "borrowing", "loan", "payable", "obligation", "assets", "currency", "financial", "financing", "capital", "working", "fund", "liquidity", "risk", "maturity", "due", "amount", "outstanding", "balance", "repayment", "facility", "credit", "line", "revolver", "note", "bond", "security", "instrument", "derivative", "hedge", "swap", "rate", "cost", "expense", "charge", "fee", "accrued", "accrual", "provision", "reserve", "allowance", "coverage", "ratio"]

@ -1,79 +0,0 @@
add(ts_mean(ts_std_dev(anl4_netdebt_flag, 63), 21), ts_zscore(anl4_netdebt_flag, 21))
subtract(multiply(ts_rank(anl4_netdebt_flag, 84), ts_delta(anl4_netdebt_flag, 42)), group_mean(anl4_netdebt_flag, 1, bucket(ts_sum(anl4_netdebt_flag, 21))))
if_else(ts_std_dev(anl4_netdebt_flag, 63) < ts_mean(ts_std_dev(anl4_netdebt_flag, 63), 252), ts_corr(anl4_netdebt_flag, ts_delay(anl4_netdebt_flag, 21), 63), reverse(ts_rank(anl4_netdebt_flag, 126)))
group_neutralize(ts_av_diff(anl4_netdebt_flag, 42), bucket(ts_scale(anl4_netdebt_flag, 1, 1, 1)))
power(ts_decay_linear(anl4_netdebt_flag, 21, false), divide(ts_sum(anl4_netdebt_flag, 63), ts_mean(anl4_netdebt_flag, 63)))
multiply(ts_zscore(anl4_netdebt_flag, 84), sign(ts_delta(anl4_netdebt_flag, 21)))
ts_regression(anl4_netdebt_flag, ts_step(1), 63, 0, 0)
rank(ts_backfill(anl4_netdebt_flag, 21, 1, "NAN"), 2)
subtract(ts_quantile(anl4_netdebt_flag, 126, "gaussian"), quantile(anl4_netdebt_flag, "gaussian", 1.0))
hump(group_zscore(anl4_netdebt_flag, bucket(ts_arg_max(anl4_netdebt_flag, 21))), 0.01)
if_else(is_nan(anl4_netdebt_flag), ts_mean(anl4_netdebt_flag, 21), ts_covariance(anl4_netdebt_flag, ts_delay(anl4_netdebt_flag, 1), 42))
add(ts_count_nans(anl4_netdebt_flag, 63), reverse(ts_rank(anl4_netdebt_flag, 84)))
group_scale(ts_product(anl4_netdebt_flag, 21), bucket(ts_arg_min(anl4_netdebt_flag, 42)))
multiply(ts_mean(anl4_netdebt_flag, 126), inverse(ts_std_dev(anl4_netdebt_flag, 63)))
trade_when(ts_delta(anl4_netdebt_flag, 21) > 0, ts_sum(anl4_netdebt_flag, 42), ts_delay(anl4_netdebt_flag, 21))
ts_scale(ts_av_diff(anl4_netdebt_flag, 84), 21, 0)
subtract(ts_sum(anl4_netdebt_flag, 63), vec_avg(bucket(ts_mean(anl4_netdebt_flag, 21))))
group_rank(ts_backfill(anl4_netdebt_flag, 42, 1, "NAN"), bucket(last_diff_value(anl4_netdebt_flag, 21)))
kth_element(anl4_netdebt_flag, 126, 1)
winsorize(ts_corr(anl4_netdebt_flag, ts_decay_linear(anl4_netdebt_flag, 21, false), 63), 4)
ts_std_dev(client_retention_rate, 90) < ts_mean(ts_std_dev(client_retention_rate, 90), 270)
ts_rank(client_retention_rate, 90) > 0.8 and ts_std_dev(client_retention_rate, 90) < ts_std_dev(client_retention_rate, 270)
group_zscore(ts_std_dev(client_retention_rate, 90), sector) < -1.0
ts_scale(client_retention_rate, 90) > 0.7 and ts_std_dev(client_retention_rate, 90) < 0.05
ts_delta(ts_std_dev(client_retention_rate, 90), 90) < 0 and ts_std_dev(client_retention_rate, 90) < ts_mean(client_retention_rate, 270) * 0.1
ts_zscore(ts_std_dev(client_retention_rate, 90), 90) < -2.0
group_neutralize(ts_std_dev(client_retention_rate, 90), industry) < 0.03
ts_decay_linear(ts_std_dev(client_retention_rate, 90), 90) < ts_decay_linear(ts_std_dev(client_retention_rate, 270), 270)
ts_count_nans(client_retention_rate, 90) == 0 and ts_std_dev(client_retention_rate, 90) < 0.02
ts_arg_min(ts_std_dev(client_retention_rate, 90), 180) < 90
ts_corr(client_retention_rate, revenue_growth, 90) > 0.6 and ts_std_dev(client_retention_rate, 90) < 0.04
ts_backfill(ts_std_dev(client_retention_rate, 90), 90, 1) < ts_mean(ts_std_dev(client_retention_rate, 90), 180)
group_scale(ts_std_dev(client_retention_rate, 90), industry) < 0.3
ts_quantile(ts_std_dev(client_retention_rate, 90), 90, "gaussian") < 0.2
ts_av_diff(ts_std_dev(client_retention_rate, 90), 90) < -0.01
ts_regression(client_retention_rate, economic_cycle_index, 90, 0, 1) > 0.5 and ts_std_dev(client_retention_rate, 90) < 0.03
ts_product(ts_std_dev(client_retention_rate, 90), 90) < 1.0e-5
ts_mean(client_retention_rate, 90) > 0.8 and ts_std_dev(client_retention_rate, 90) < 0.01
ts_step(1) % 90 == 0 and ts_std_dev(client_retention_rate, 90) < 0.02
rank(ts_std_dev(client_retention_rate, 90), 0) > 0.9 and group_zscore(ts_std_dev(client_retention_rate, 90), country) < -0.5
Loading…
Cancel
Save