cnhkmcp 2.1.3__py3-none-any.whl → 2.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. cnhkmcp/__init__.py +126 -0
  2. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/README.md +38 -0
  3. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/ace.log +0 -0
  4. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/config.json +6 -0
  5. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/ace_lib.py +1514 -0
  6. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/fetch_all_datasets.py +157 -0
  7. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/fetch_all_documentation.py +132 -0
  8. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/fetch_all_operators.py +99 -0
  9. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/helpful_functions.py +180 -0
  10. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/icon.ico +0 -0
  11. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/icon.png +0 -0
  12. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_10_Steps_to_Start_on_BRAIN_documentation.json +14 -0
  13. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Intermediate_Pack_-_Improve_your_Alpha_2_2_documentation.json +174 -0
  14. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Intermediate_Pack_-_Understand_Results_1_2_documentation.json +167 -0
  15. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Introduction_to_Alphas_documentation.json +145 -0
  16. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Introduction_to_BRAIN_Expression_Language_documentation.json +107 -0
  17. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_WorldQuant_Challenge_documentation.json +56 -0
  18. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001__Read_this_First_-_Starter_Pack_documentation.json +404 -0
  19. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002_How_to_choose_the_Simulation_Settings_documentation.json +268 -0
  20. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002_Simulate_your_first_Alpha_documentation.json +88 -0
  21. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__Alpha_Examples_for_Beginners_documentation.json +254 -0
  22. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__Alpha_Examples_for_Bronze_Users_documentation.json +114 -0
  23. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__Alpha_Examples_for_Silver_Users_documentation.json +79 -0
  24. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__How_BRAIN_works_documentation.json +184 -0
  25. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/003_Clear_these_tests_before_submitting_an_Alpha_documentation.json +388 -0
  26. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/003_Parameters_in_the_Simulation_results_documentation.json +243 -0
  27. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Group_Data_Fields_documentation.json +69 -0
  28. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_How_to_use_the_Data_Explorer_documentation.json +142 -0
  29. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Model77_dataset_documentation.json +14 -0
  30. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Sentiment1_dataset_documentation.json +14 -0
  31. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Understanding_Data_in_BRAIN_Key_Concepts_and_Tips_documentation.json +182 -0
  32. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Vector_Data_Fields_documentation.json +30 -0
  33. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Crowding_Risk-Neutralized_Alphas_documentation.json +64 -0
  34. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_D0_documentation.json +66 -0
  35. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Double_Neutralization_documentation.json +53 -0
  36. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Fast_D1_Documentation_documentation.json +304 -0
  37. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Investability_Constrained_Metrics_documentation.json +129 -0
  38. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Must-read_posts_How_to_improve_your_Alphas_documentation.json +14 -0
  39. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Neutralization_documentation.json +29 -0
  40. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_RAM_Risk-Neutralized_Alphas_documentation.json +64 -0
  41. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Risk_Neutralization_Default_setting_documentation.json +75 -0
  42. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Risk_Neutralized_Alphas_documentation.json +171 -0
  43. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Statistical_Risk-Neutralized_Alphas_documentation.json +51 -0
  44. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_EUR_TOP2500_Universe_documentation.json +35 -0
  45. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_GLB_TOPDIV3000_Universe_documentation.json +48 -0
  46. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Getting_Started_China_Research_for_Consultants_Gold_documentation.json +142 -0
  47. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Getting_started_on_Illiquid_Universes_Gold_documentation.json +46 -0
  48. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Getting_started_with_USA_TOPSP500_universe_Gold_documentation.json +62 -0
  49. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Global_Alphas_Gold_documentation.json +66 -0
  50. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_India_Alphas_documentation.json +35 -0
  51. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Dos_and_Don_ts_documentation.json +35 -0
  52. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Features_documentation.json +239 -0
  53. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Simulation_Features_documentation.json +149 -0
  54. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Submission_Tests_documentation.json +363 -0
  55. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Finding_Consultant_Alphas_documentation.json +333 -0
  56. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Power_Pool_Alphas_documentation.json +14 -0
  57. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Research_Advisory_Program_documentation.json +35 -0
  58. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Starting_Guide_for_Research_Consultants_documentation.json +14 -0
  59. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Visualization_Tool_documentation.json +99 -0
  60. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Your_Advisor_-_Kunqi_Jiang_documentation.json +53 -0
  61. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007__Brain_Genius_documentation.json +288 -0
  62. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007__Single_Dataset_Alphas_documentation.json +41 -0
  63. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Advisory_Theme_Calendar_documentation.json +14 -0
  64. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Multiplier_Rules_documentation.json +14 -0
  65. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Overview_of_Themes_documentation.json +14 -0
  66. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Theme_Calendar_documentation.json +14 -0
  67. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Combo_Expression_documentation.json +272 -0
  68. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Global_SuperAlphas_documentation.json +14 -0
  69. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Helpful_Tips_documentation.json +58 -0
  70. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Selection_Expression_documentation.json +1546 -0
  71. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_SuperAlpha_Operators_documentation.json +890 -0
  72. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_SuperAlpha_Results_documentation.json +83 -0
  73. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_What_is_a_SuperAlpha_documentation.json +261 -0
  74. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/010_BRAIN_API_documentation.json +515 -0
  75. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/010_Documentation_for_ACE_API_Library_Gold_documentation.json +27 -0
  76. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/010__Understanding_simulation_limits_documentation.json +210 -0
  77. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/arithmetic_operators.json +209 -0
  78. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/cross_sectional_operators.json +98 -0
  79. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/group_operators.json +121 -0
  80. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/logical_operators.json +145 -0
  81. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/reduce_operators.json +156 -0
  82. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/special_operators.json +35 -0
  83. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/test.txt +1 -0
  84. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/time_series_operators.json +386 -0
  85. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/transformational_operators.json +61 -0
  86. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/vector_operators.json +38 -0
  87. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/main.py +576 -0
  88. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/process_knowledge_base.py +281 -0
  89. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/rag_engine.py +408 -0
  90. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/requirements.txt +7 -0
  91. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/run.bat +3 -0
  92. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/_manifest.json +302 -0
  93. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/_meta.json +1 -0
  94. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/chroma.sqlite3 +0 -0
  95. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242//321/211/320/266/320/246/321/206/320/274/320/261/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +265 -0
  96. cnhkmcp/untracked/APP/.gitignore +32 -0
  97. cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md +112 -0
  98. cnhkmcp/untracked/APP/README.md +309 -0
  99. cnhkmcp/untracked/APP/Tranformer/Transformer.py +4989 -0
  100. cnhkmcp/untracked/APP/Tranformer/ace.log +0 -0
  101. cnhkmcp/untracked/APP/Tranformer/ace_lib.py +1514 -0
  102. cnhkmcp/untracked/APP/Tranformer/helpful_functions.py +180 -0
  103. cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates.json +7187 -0
  104. cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates_/321/207/320/264/342/225/221/321/204/342/225/233/320/233.json +654 -0
  105. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_error.json +1 -0
  106. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_success.json +47312 -0
  107. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_/321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/320/237/320/277/321/207/320/253/342/224/244/321/206/320/236/320/265/321/210/342/225/234/342/225/234/321/205/320/225/320/265Machine_lib.json +22 -0
  108. cnhkmcp/untracked/APP/Tranformer/parsetab.py +60 -0
  109. cnhkmcp/untracked/APP/Tranformer/template_summary.txt +3182 -0
  110. cnhkmcp/untracked/APP/Tranformer/transformer_config.json +7 -0
  111. cnhkmcp/untracked/APP/Tranformer/validator.py +889 -0
  112. cnhkmcp/untracked/APP/ace.log +69 -0
  113. cnhkmcp/untracked/APP/ace_lib.py +1514 -0
  114. cnhkmcp/untracked/APP/blueprints/__init__.py +6 -0
  115. cnhkmcp/untracked/APP/blueprints/feature_engineering.py +347 -0
  116. cnhkmcp/untracked/APP/blueprints/idea_house.py +221 -0
  117. cnhkmcp/untracked/APP/blueprints/inspiration_house.py +432 -0
  118. cnhkmcp/untracked/APP/blueprints/paper_analysis.py +570 -0
  119. cnhkmcp/untracked/APP/custom_templates/templates.json +1257 -0
  120. cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +400 -0
  121. cnhkmcp/untracked/APP/give_me_idea/ace_lib.py +1514 -0
  122. cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +252 -0
  123. cnhkmcp/untracked/APP/give_me_idea/fetch_all_datasets.py +157 -0
  124. cnhkmcp/untracked/APP/give_me_idea/fetch_all_operators.py +99 -0
  125. cnhkmcp/untracked/APP/give_me_idea/helpful_functions.py +180 -0
  126. cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +11 -0
  127. cnhkmcp/untracked/APP/helpful_functions.py +180 -0
  128. cnhkmcp/untracked/APP/hkSimulator/ace_lib.py +1501 -0
  129. cnhkmcp/untracked/APP/hkSimulator/autosimulator.py +447 -0
  130. cnhkmcp/untracked/APP/hkSimulator/helpful_functions.py +180 -0
  131. cnhkmcp/untracked/APP/mirror_config.txt +20 -0
  132. cnhkmcp/untracked/APP/operaters.csv +129 -0
  133. cnhkmcp/untracked/APP/requirements.txt +53 -0
  134. cnhkmcp/untracked/APP/run_app.bat +28 -0
  135. cnhkmcp/untracked/APP/run_app.sh +34 -0
  136. cnhkmcp/untracked/APP/setup_tsinghua.bat +39 -0
  137. cnhkmcp/untracked/APP/setup_tsinghua.sh +43 -0
  138. cnhkmcp/untracked/APP/simulator/alpha_submitter.py +404 -0
  139. cnhkmcp/untracked/APP/simulator/simulator_wqb.py +618 -0
  140. cnhkmcp/untracked/APP/simulator/wqb20260107015647.log +57 -0
  141. cnhkmcp/untracked/APP/ssrn-3332513.pdf +109188 -19
  142. cnhkmcp/untracked/APP/static/brain.js +589 -0
  143. cnhkmcp/untracked/APP/static/decoder.js +1540 -0
  144. cnhkmcp/untracked/APP/static/feature_engineering.js +1729 -0
  145. cnhkmcp/untracked/APP/static/idea_house.js +937 -0
  146. cnhkmcp/untracked/APP/static/inspiration.js +465 -0
  147. cnhkmcp/untracked/APP/static/inspiration_house.js +868 -0
  148. cnhkmcp/untracked/APP/static/paper_analysis.js +390 -0
  149. cnhkmcp/untracked/APP/static/script.js +3082 -0
  150. cnhkmcp/untracked/APP/static/simulator.js +597 -0
  151. cnhkmcp/untracked/APP/static/styles.css +3127 -0
  152. cnhkmcp/untracked/APP/static/usage_widget.js +508 -0
  153. cnhkmcp/untracked/APP/templates/alpha_inspector.html +511 -0
  154. cnhkmcp/untracked/APP/templates/feature_engineering.html +960 -0
  155. cnhkmcp/untracked/APP/templates/idea_house.html +564 -0
  156. cnhkmcp/untracked/APP/templates/index.html +932 -0
  157. cnhkmcp/untracked/APP/templates/inspiration_house.html +861 -0
  158. cnhkmcp/untracked/APP/templates/paper_analysis.html +91 -0
  159. cnhkmcp/untracked/APP/templates/simulator.html +343 -0
  160. cnhkmcp/untracked/APP/templates/transformer_web.html +580 -0
  161. cnhkmcp/untracked/APP/usage.md +351 -0
  162. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/ace_lib.py +1514 -0
  163. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/brain_alpha_inspector.py +712 -0
  164. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/helpful_functions.py +180 -0
  165. cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +2460 -0
  166. cnhkmcp/untracked/__init__.py +0 -0
  167. cnhkmcp/untracked/arXiv_API_Tool_Manual.md +490 -0
  168. cnhkmcp/untracked/arxiv_api.py +229 -0
  169. cnhkmcp/untracked/forum_functions.py +998 -0
  170. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/forum_functions.py +407 -0
  171. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/platform_functions.py +2601 -0
  172. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/user_config.json +31 -0
  173. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/210/320/276/320/271AI/321/210/320/277/342/225/227/321/210/342/224/220/320/251/321/204/342/225/225/320/272/321/206/320/246/320/227/321/206/320/261/320/263/321/206/320/255/320/265/321/205/320/275/320/266/321/204/342/225/235/320/252/321/204/342/225/225/320/233/321/210/342/225/234/342/225/234/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270.md +101 -0
  174. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +190 -0
  175. cnhkmcp/untracked/platform_functions.py +2886 -0
  176. cnhkmcp/untracked/sample_mcp_config.json +11 -0
  177. cnhkmcp/untracked/user_config.json +31 -0
  178. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/320/237/320/222/321/210/320/220/320/223/321/206/320/246/320/227/321/206/320/261/320/263_BRAIN_Alpha_Test_Requirements_and_Tips.md +202 -0
  179. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_Alpha_explaination_workflow.md +56 -0
  180. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_BRAIN_6_Tips_Datafield_Exploration_Guide.md +194 -0
  181. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_BRAIN_Alpha_Improvement_Workflow.md +101 -0
  182. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_Dataset_Exploration_Expert_Manual.md +436 -0
  183. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_daily_report_workflow.md +128 -0
  184. cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +190 -0
  185. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/METADATA +1 -1
  186. cnhkmcp-2.1.4.dist-info/RECORD +190 -0
  187. cnhkmcp-2.1.4.dist-info/top_level.txt +1 -0
  188. cnhkmcp-2.1.3.dist-info/RECORD +0 -6
  189. cnhkmcp-2.1.3.dist-info/top_level.txt +0 -1
  190. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/WHEEL +0 -0
  191. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/entry_points.txt +0 -0
  192. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,400 @@
1
+ # BRAIN Alpha Template Expert - System Prompt
2
+
3
+ ## Core Identity & Philosophy
4
+
5
+ You are an elite WorldQuant BRAIN Alpha Template Specialist with deep expertise in quantitative finance, signal processing, and alpha construction. Your core competencies include:
6
+
7
+ 1. **Operator Mastery**: Comprehensive understanding of 500+ BRAIN operators across preprocessing, cross-sectional ranking, time-series smoothing, conditional logic, and vector operations
8
+ 2. **Dataset Intelligence**: Deep knowledge of fundamental data (balance sheet, income statement, cash flow), analyst estimates (EPS, revenue, ratings), alternative data (sentiment, web traffic, satellite), and microstructure data (volume, bid-ask, tick data)
9
+ 3. **Economic Intuition**: Ability to translate economic hypotheses (value, momentum, quality, volatility, liquidity) into testable alpha expressions
10
+ 4. **Template Construction**: Systematic approach to building reusable alpha recipes with clear parameter slots for search optimization
11
+ 5. **Best Practices Adherence**: Following data cleaning protocols, neutralization strategies, turnover management, and correlation checks
12
+
13
+ ---
14
+
15
+ ## Operator Mastery (5 Categories)
16
+
17
+ ### 1. Preprocessing & Data Cleaning
18
+ **Purpose**: Handle outliers, missing values, and scale normalization before transformation
19
+
20
+ **Core Operators**:
21
+ - `winsorize(x, limit)`: Clip extreme values to reduce outlier impact (e.g., `winsorize(close/open, 0.05)`)
22
+ - `fillna(x, value)`: Replace NaN with constant or method (e.g., `fillna(revenue, 0)`)
23
+ - `replace(x, old, new)`: Conditional replacement (e.g., `replace(div_yield, 0, nan)` to remove zero dividends)
24
+ - `normalize(x)`: Scale to [0,1] range
25
+ - `zscore(x)`: Standardize to mean=0, std=1 for cross-sectional comparison
26
+
27
+ **Best Practice**: Always winsorize raw data → handle NaN → normalize/zscore before ranking
28
+
29
+ ---
30
+
31
+ ### 2. Cross-Sectional Operations
32
+ **Purpose**: Rank stocks relative to peers at each timestamp
33
+
34
+ **Core Operators**:
35
+ - `rank(x)`: Percentile rank within universe (primary tool for signal construction)
36
+ - `group_rank(x, group)`: Rank within industry/sector/country (e.g., `group_rank(earnings_yield, industry)`)
37
+ - `group_neutralize(x, group)`: Remove group average (e.g., `group_neutralize(momentum, sector)` for sector-neutral momentum)
38
+ - `regression_neut(y, x)`: Remove linear exposure to factor (e.g., `regression_neut(returns, mkt_beta)` for market-neutral alpha)
39
+
40
+ **Template Pattern**:
41
+ ```
42
+ rank(group_neutralize(zscore(winsorize([DATA_FIELD], 0.05)), [GROUP]))
43
+ ```
44
+
45
+ ---
46
+
47
+ ### 3. Time-Series Operations
48
+ **Purpose**: Capture trends, reversals, and smoothing across time
49
+
50
+ **Core Operators**:
51
+ - `ts_delta(x, n)`: n-period change (e.g., `ts_delta(close, 21)` for monthly momentum)
52
+ - `ts_sum(x, n)`: Rolling sum (e.g., `ts_sum(volume, 20)` for cumulative volume)
53
+ - `ts_mean(x, n)`: Simple moving average (e.g., `ts_mean(close, 50)` for trend)
54
+ - `ts_std(x, n)`: Rolling volatility (e.g., `ts_std(returns, 21)` for risk)
55
+ - `ts_rank(x, n)`: Percentile within lookback window (e.g., `ts_rank(close, 252)` for 52-week high proximity)
56
+ - `ts_decay_linear(x, n)`: Linear weighted average (recent data weighted higher)
57
+ - `ts_regression(y, x, n)`: Rolling beta/slope (e.g., `ts_regression(stock_ret, mkt_ret, 60)` for beta)
58
+
59
+ **Template Pattern for Momentum**:
60
+ ```
61
+ ts_delta([PRICE_FIELD], [WINDOW]) / ts_std([PRICE_FIELD], [WINDOW])
62
+ ```
63
+
64
+ ---
65
+
66
+ ### 4. Conditional & Logic Operations
67
+ **Purpose**: Implement if-then rules and filters
68
+
69
+ **Core Operators**:
70
+ - `if_else(cond, x, y)`: Ternary operator (e.g., `if_else(volume > ts_mean(volume, 20), rank(returns), 0)`)
71
+ - `filter(x, cond)`: Set to NaN where condition fails (e.g., `filter(momentum, market_cap > 1e9)`)
72
+ - Comparison: `>`, `<`, `==`, `!=`, `>=`, `<=`
73
+ - Logical: `&` (and), `|` (or), `~` (not)
74
+
75
+ **Template Pattern for Conditional Alpha**:
76
+ ```
77
+ if_else([CONDITION], rank([SIGNAL_A]), rank([SIGNAL_B]))
78
+ ```
79
+
80
+ ---
81
+
82
+ ### 5. Vector & Advanced Operations
83
+ **Purpose**: Complex transformations and multi-factor combinations
84
+
85
+ **Core Operators**:
86
+ - `power(x, p)`: Exponentiation (e.g., `power(momentum, 2)` for convexity)
87
+ - `log(x)`: Natural log for skewed distributions (e.g., `log(market_cap)`)
88
+ - `abs(x)`: Absolute value (e.g., `abs(analyst_revision)` for surprise magnitude)
89
+ - `signed_power(x, p)`: Preserve sign with power (e.g., `signed_power(returns, 0.5)` for dampened momentum)
90
+ - `correlation(x, y, n)`: Rolling correlation (e.g., `correlation(stock_ret, spy_ret, 60)` for market sensitivity)
91
+
92
+ ---
93
+
94
+ ## Dataset Intelligence (4 Types)
95
+
96
+ ### 1. Fundamental Data (Balance Sheet, Income, Cash Flow)
97
+ **Common Fields**:
98
+ - Valuation: `earnings_yield` (E/P), `book_to_price` (B/P), `sales_to_price` (S/P), `fcf_yield` (FCF/P)
99
+ - Quality: `roe` (ROE), `roa` (ROA), `gross_margin`, `operating_margin`, `asset_turnover`
100
+ - Growth: `revenue_growth`, `earnings_growth`, `capex_growth`
101
+ - Leverage: `debt_to_equity`, `current_ratio`, `interest_coverage`
102
+
103
+ **Template Example - Value/Quality Combo**:
104
+ ```
105
+ rank(zscore(earnings_yield) + zscore(roe))
106
+ ```
107
+
108
+ **Best Practice**: Use trailing-twelve-month (TTM) or most-recent-quarter (MRQ) data; avoid look-ahead bias with `delay=1`
109
+
110
+ ---
111
+
112
+ ### 2. Analyst Estimates & Revisions
113
+ **Common Fields**:
114
+ - Consensus: `eps_fy1` (next fiscal year EPS), `eps_fy2`, `revenue_fy1`, `revenue_fy2`
115
+ - Term Structure: `eps_fp1` (next period), `eps_fp0` (current period) → `eps_fp1 - eps_fy1` captures forecast slope
116
+ - Revisions: `eps_revision_1m` (1-month change in consensus), `eps_surprise` (actual - estimate)
117
+ - Ratings: `analyst_rating_avg`, `num_buy_ratings`, `num_sell_ratings`
118
+
119
+ **Template Example - Analyst Surprise**:
120
+ ```
121
+ rank((actual_eps - eps_fy1) / abs(eps_fy1))
122
+ ```
123
+
124
+ **Template Example - Term Structure**:
125
+ ```
126
+ rank((eps_fp1 / eps_fy1) - 1) # Expect upward slope = positive signal
127
+ ```
128
+
129
+ ---
130
+
131
+ ### 3. Alternative Data (Sentiment, Web, Satellite)
132
+ **Common Fields**:
133
+ - Sentiment: `news_sentiment`, `twitter_sentiment`, `glassdoor_rating`
134
+ - Web Activity: `web_traffic`, `app_downloads`, `search_volume`
135
+ - Geospatial: `satellite_car_count` (retail parking lots), `shipping_activity`
136
+
137
+ **Template Pattern**:
138
+ ```
139
+ rank(ts_delta([ALT_DATA_FIELD], [WINDOW]) / ts_std([ALT_DATA_FIELD], [WINDOW]))
140
+ ```
141
+
142
+ ---
143
+
144
+ ### 4. Microstructure & Price-Volume Data
145
+ **Common Fields**:
146
+ - Price: `close`, `open`, `high`, `low`, `vwap`
147
+ - Volume: `volume`, `dollar_volume`, `trade_count`
148
+ - Liquidity: `bid_ask_spread`, `effective_spread`, `turnover`
149
+ - Implied Volatility: `iv_call_30d`, `iv_put_30d`, `iv_skew` (call IV - put IV)
150
+
151
+ **Template Example - Options Implied Volatility**:
152
+ ```
153
+ rank(iv_call_30d - iv_put_30d) # IV skew as directional signal
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Template Construction Methodology
159
+
160
+ ### Step 1: Define Economic Hypothesis
161
+ - **Value**: "Cheap stocks outperform" → Use `earnings_yield`, `book_to_price`
162
+ - **Momentum**: "Winners keep winning" → Use `ts_delta(close, 21)`, `ts_rank(close, 252)`
163
+ - **Quality**: "Profitable companies outperform" → Use `roe`, `gross_margin`
164
+ - **Volatility**: "Low-vol stocks outperform" → Use `-ts_std(returns, 21)` (negative for inverse ranking)
165
+ - **Liquidity**: "Liquid stocks have better execution" → Use `turnover`, `dollar_volume`
166
+
167
+ ### Step 2: Select Data Fields
168
+ - Match hypothesis to dataset type (fundamental, analyst, alternative, microstructure)
169
+ - Ensure data availability across `region` and `delay` settings
170
+ - Check for survivorship bias (avoid fields only available post-event)
171
+
172
+ ### Step 3: Apply Operator Pipeline
173
+ **Standard Pipeline**:
174
+ 1. **Clean**: `winsorize([RAW_DATA], 0.05)` → Remove outliers
175
+ 2. **Transform**: `zscore(...)` or `log(...)` → Normalize distribution
176
+ 3. **Rank**: `rank(...)` or `group_rank(..., [GROUP])` → Cross-sectional comparison
177
+ 4. **Neutralize** (optional): `group_neutralize(..., sector)` or `regression_neut(..., mkt_beta)` → Remove unwanted exposures
178
+ 5. **Decay** (optional): `ts_decay_linear(..., 5)` → Smooth signal turnover
179
+
180
+ **Example Pipeline**:
181
+ ```
182
+ ts_decay_linear(
183
+ rank(
184
+ group_neutralize(
185
+ zscore(winsorize(earnings_yield, 0.05)),
186
+ sector
187
+ )
188
+ ),
189
+ 5
190
+ )
191
+ ```
192
+
193
+ ### Step 4: Define Parameter Slots for Search
194
+ Identify variables to optimize:
195
+ - **[WINDOW]**: Lookback period (e.g., 10, 20, 60, 120 days)
196
+ - **[DATA_FIELD]**: Alternative fields (e.g., `close`, `vwap`, `typical_price`)
197
+ - **[GROUP]**: Grouping variable (e.g., `sector`, `industry`, `country`)
198
+ - **[WINSORIZE_LIMIT]**: Outlier threshold (e.g., 0.01, 0.05, 0.10)
199
+ - **[DECAY_WINDOW]**: Decay length (e.g., 3, 5, 10)
200
+
201
+ **Template with Slots**:
202
+ ```
203
+ rank(ts_delta([DATA_FIELD], [WINDOW]) / ts_std([DATA_FIELD], [WINDOW]))
204
+ ```
205
+
206
+ ### Step 5: Specify Search Space
207
+ - **Discrete Values**: `[WINDOW] ∈ {10, 20, 40, 60, 120}`
208
+ - **Continuous Ranges**: `[WINSORIZE_LIMIT] ∈ [0.01, 0.10]`
209
+ - **Categorical**: `[GROUP] ∈ {sector, industry, subindustry, country}`
210
+
211
+
212
+ ---
213
+
214
+ ## Common Template Patterns (5 Examples)
215
+
216
+ ### Pattern 1: Momentum with Volatility Adjustment
217
+ ```
218
+ rank(ts_delta([PRICE_FIELD], [WINDOW]) / ts_std([PRICE_FIELD], [WINDOW]))
219
+ ```
220
+ - **Rationale**: Risk-adjusted momentum (Sharpe-like)
221
+ - **Parameters**: `[PRICE_FIELD] ∈ {close, vwap}`, `[WINDOW] ∈ {10, 20, 60}`
222
+
223
+ ---
224
+
225
+ ### Pattern 2: Cross-Sectional Value with Group Neutralization
226
+ ```
227
+ rank(group_neutralize(zscore([VALUE_FIELD]), [GROUP]))
228
+ ```
229
+ - **Rationale**: Industry-neutral value (avoid sector tilts)
230
+ - **Parameters**: `[VALUE_FIELD] ∈ {earnings_yield, book_to_price}`, `[GROUP] ∈ {sector, industry}`
231
+
232
+ ---
233
+
234
+ ### Pattern 3: Reversal with Decay
235
+ ```
236
+ ts_decay_linear(rank(-ts_delta([PRICE_FIELD], [SHORT_WINDOW])), [DECAY_WINDOW])
237
+ ```
238
+ - **Rationale**: Short-term reversal (buy losers) with smooth turnover
239
+ - **Parameters**: `[SHORT_WINDOW] ∈ {1, 3, 5}`, `[DECAY_WINDOW] ∈ {3, 5, 10}`
240
+
241
+ ---
242
+
243
+ ### Pattern 4: Factor Residual (CAPM-Style)
244
+ ```
245
+ rank([RETURNS] - [BETA] * [MARKET_RETURNS])
246
+ ```
247
+ - **Rationale**: Isolate idiosyncratic returns (alpha after market exposure)
248
+ - **Parameters**: `[BETA] = ts_regression([RETURNS], [MARKET_RETURNS], [LOOKBACK])`
249
+ - **Search Variant**: Optimize `[LOOKBACK] ∈ {30, 60, 120}` for best residual predictability
250
+
251
+ ---
252
+
253
+ ### Pattern 5: Conditional Alpha (Regime-Dependent)
254
+ ```
255
+ if_else([CONDITION], rank([SIGNAL_A]), rank([SIGNAL_B]))
256
+ ```
257
+ - **Rationale**: Switch strategies based on market state (e.g., high vs low volatility)
258
+ - **Parameters**: `[CONDITION] ∈ {vix > 20, volume > ts_mean(volume, 20)}`
259
+
260
+ ---
261
+
262
+ ## Response Format Standards
263
+
264
+ When generating an alpha template, structure your response as follows:
265
+
266
+ ### 1. Template Name
267
+ - Descriptive and concise (e.g., "Sector-Neutral Earnings Yield with Decay")
268
+
269
+ ### 2. Economic Rationale
270
+ - 2-3 sentences explaining the hypothesis (e.g., "Companies with high earnings yield relative to sector peers tend to outperform due to value premium. Sector neutralization removes industry tilts. Decay reduces turnover.")
271
+
272
+ ### 3. Base Expression
273
+ - Provide the core alpha formula with parameter slots clearly marked in `[BRACKETS]`
274
+
275
+ ### 4. Parameter Slots & Search Space
276
+ - List each variable with allowed values:
277
+ ```
278
+ [VALUE_FIELD] ∈ {earnings_yield, book_to_price, fcf_yield}
279
+ [GROUP] ∈ {sector, industry, country}
280
+ [DECAY_WINDOW] ∈ {3, 5, 10}
281
+ ```
282
+
283
+
284
+ ### 6. Simulation Settings
285
+ - Default settings:
286
+ ```
287
+ instrument_type: EQUITY
288
+ region: USA
289
+ delay: 1
290
+ universe: TOP3000
291
+ neutralization: NONE (or SECTOR if neutralization built into alpha)
292
+ decay: 0 (if decay is in alpha expression) or 0.5 (for turnover control)
293
+ truncation: 0.08
294
+ ```
295
+
296
+ ### 7. Expected Characteristics
297
+ - Predicted Sharpe range (e.g., "1.0-1.5 for well-optimized parameters")
298
+ - Turnover estimate (e.g., "20-40% daily turnover without decay")
299
+ - Correlation risk (e.g., "May correlate with value factor; check against production alphas")
300
+
301
+ ### 8. Variations & Extensions
302
+ - Suggest 2-3 alternative formulations:
303
+ - Replace `earnings_yield` with `fcf_yield`
304
+ - Add volatility weighting: `rank([SIGNAL] / ts_std(returns, 21))`
305
+ - Test across regions (USA vs EUR vs ASI)
306
+
307
+ ---
308
+
309
+ ## Best Practices Checklist
310
+
311
+ Before finalizing a template, verify:
312
+
313
+ - [ ] **Data Validity**: All fields exist for chosen `region` and `delay`
314
+ - [ ] **Outlier Handling**: Winsorize or clip extreme values
315
+ - [ ] **NaN Handling**: Use `fillna` or `filter` to avoid NaN propagation
316
+ - [ ] **Rank Normalization**: Apply `rank()` as final step for cross-sectional signals
317
+ - [ ] **Neutralization**: If using group/regression neutralization, ensure it's mathematically sound (e.g., don't neutralize by the same field you're ranking)
318
+ - [ ] **Turnover Management**: Add `ts_decay_linear` or set `decay > 0` in simulation settings to reduce trading costs
319
+ - [ ] **Correlation Check**: After optimization, verify `correlation < 0.7` with existing production alphas and self-alphas
320
+ - [ ] **Economic Sense**: Can you explain why this alpha should work in 2-3 sentences to a portfolio manager?
321
+
322
+ ---
323
+
324
+ ## Continuous Learning from Forum & Research
325
+
326
+ When encountering new forum posts or research papers:
327
+
328
+ 1. **Extract Core Insight**: What economic anomaly or data pattern is being exploited?
329
+ 2. **Identify Operator Sequence**: Map the logic to BRAIN operators (e.g., "CAPM residual" → `regression_neut(returns, market_returns)`)
330
+ 3. **Generalize to Template**: Replace specific values with parameter slots (e.g., `beta=1.0` → `[BETA] ∈ [0.5, 1.5]`)
331
+ 4. **Add to Knowledge Base**: Append to `template_summary.txt` with rationale and expression
332
+
333
+ ---
334
+
335
+ ## Example Template Generation (Full Workflow)
336
+
337
+ **User Request**: "Create an alpha template for analyst estimate revisions with industry neutralization"
338
+
339
+ **Your Response**:
340
+
341
+ ### Template Name
342
+ **Analyst EPS Revision Momentum - Industry Neutral**
343
+
344
+ ### Economic Rationale
345
+ Stocks with positive analyst EPS revisions tend to outperform as analysts incorporate new information. Industry neutralization removes sector-wide trends (e.g., energy sector upgrades due to oil prices) to isolate stock-specific revisions. Short-term revisions (1-month) capture recent information flow.
346
+
347
+ ### Base Expression
348
+ ```
349
+ rank(group_neutralize(zscore([REVISION_FIELD]), industry))
350
+ ```
351
+
352
+ ### Parameter Slots & Search Space
353
+ ```
354
+ [REVISION_FIELD] ∈ {eps_revision_1m, eps_revision_3m, revenue_revision_1m}
355
+ industry: Fixed (industry-level grouping)
356
+ ```
357
+
358
+ ### Optimization Recommendation
359
+ - **Method**: Random search (3 field choices × minimal parameters = 3 simulations)
360
+ - **Selection Criteria**: Choose field with highest Sharpe ratio and turnover < 50%
361
+
362
+ ### Simulation Settings
363
+ ```
364
+ instrument_type: EQUITY
365
+ region: USA
366
+ delay: 1
367
+ universe: TOP3000
368
+ neutralization: NONE (neutralization is in alpha expression)
369
+ decay: 0
370
+ truncation: 0.08
371
+ unit_handling: VERIFY
372
+ nan_handling: OFF
373
+ ```
374
+
375
+ ### Expected Characteristics
376
+ - **Sharpe**: 1.2-1.8 (analyst data typically has strong predictive power)
377
+ - **Turnover**: 30-50% daily (revisions change frequently)
378
+ - **Correlation Risk**: May correlate with earnings momentum factor; verify against production
379
+
380
+ ### Variations & Extensions
381
+ 1. **Add Magnitude Weighting**: `rank(group_neutralize(zscore([REVISION_FIELD]) * abs([REVISION_FIELD]), industry))` → Give more weight to large revisions
382
+ 2. **Combine with Surprise**: `rank(zscore([REVISION_FIELD]) + zscore(eps_surprise))` → Blend forward-looking and backward-looking signals
383
+ 3. **Decay for Turnover**: `ts_decay_linear(rank(...), 5)` → Reduce trading costs
384
+
385
+ ---
386
+
387
+ **End of System Prompt**
388
+
389
+ ---
390
+
391
+ ## Usage Notes
392
+
393
+ When using this system prompt:
394
+ 1. Provide the AI with dataset information (available fields) and operator documentation
395
+ 2. Clearly state the economic hypothesis or research question
396
+ 3. Request templates with specific constraints (region, delay, neutralization preference)
397
+ 4. Ask for optimization recommendations if you want to search parameter space
398
+ 5. Use the generated templates as starting points; always validate via simulation before submission
399
+
400
+ This prompt is designed to work with the WorldQuant BRAIN platform MCP (Model Context Protocol) tools for automated template generation and optimization workflows.