cnhkmcp 2.1.3__py3-none-any.whl → 2.1.5__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.
- cnhkmcp/__init__.py +126 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- cnhkmcp/untracked/APP/.gitignore +32 -0
- cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md +112 -0
- cnhkmcp/untracked/APP/README.md +309 -0
- cnhkmcp/untracked/APP/Tranformer/Transformer.py +4989 -0
- cnhkmcp/untracked/APP/Tranformer/ace.log +0 -0
- cnhkmcp/untracked/APP/Tranformer/ace_lib.py +1514 -0
- cnhkmcp/untracked/APP/Tranformer/helpful_functions.py +180 -0
- cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates.json +7187 -0
- cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates_/321/207/320/264/342/225/221/321/204/342/225/233/320/233.json +654 -0
- cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_error.json +1 -0
- cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_success.json +47312 -0
- 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
- cnhkmcp/untracked/APP/Tranformer/parsetab.py +60 -0
- cnhkmcp/untracked/APP/Tranformer/template_summary.txt +3182 -0
- cnhkmcp/untracked/APP/Tranformer/transformer_config.json +7 -0
- cnhkmcp/untracked/APP/Tranformer/validator.py +889 -0
- cnhkmcp/untracked/APP/ace.log +69 -0
- cnhkmcp/untracked/APP/ace_lib.py +1514 -0
- cnhkmcp/untracked/APP/blueprints/__init__.py +6 -0
- cnhkmcp/untracked/APP/blueprints/feature_engineering.py +347 -0
- cnhkmcp/untracked/APP/blueprints/idea_house.py +221 -0
- cnhkmcp/untracked/APP/blueprints/inspiration_house.py +432 -0
- cnhkmcp/untracked/APP/blueprints/paper_analysis.py +570 -0
- cnhkmcp/untracked/APP/custom_templates/templates.json +1257 -0
- cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +400 -0
- cnhkmcp/untracked/APP/give_me_idea/ace_lib.py +1514 -0
- cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +252 -0
- cnhkmcp/untracked/APP/give_me_idea/fetch_all_datasets.py +157 -0
- cnhkmcp/untracked/APP/give_me_idea/fetch_all_operators.py +99 -0
- cnhkmcp/untracked/APP/give_me_idea/helpful_functions.py +180 -0
- cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +11 -0
- cnhkmcp/untracked/APP/helpful_functions.py +180 -0
- cnhkmcp/untracked/APP/hkSimulator/ace_lib.py +1501 -0
- cnhkmcp/untracked/APP/hkSimulator/autosimulator.py +447 -0
- cnhkmcp/untracked/APP/hkSimulator/helpful_functions.py +180 -0
- cnhkmcp/untracked/APP/mirror_config.txt +20 -0
- cnhkmcp/untracked/APP/operaters.csv +129 -0
- cnhkmcp/untracked/APP/requirements.txt +53 -0
- cnhkmcp/untracked/APP/run_app.bat +28 -0
- cnhkmcp/untracked/APP/run_app.sh +34 -0
- cnhkmcp/untracked/APP/setup_tsinghua.bat +39 -0
- cnhkmcp/untracked/APP/setup_tsinghua.sh +43 -0
- cnhkmcp/untracked/APP/simulator/alpha_submitter.py +404 -0
- cnhkmcp/untracked/APP/simulator/simulator_wqb.py +618 -0
- cnhkmcp/untracked/APP/ssrn-3332513.pdf +109188 -19
- cnhkmcp/untracked/APP/static/brain.js +589 -0
- cnhkmcp/untracked/APP/static/decoder.js +1540 -0
- cnhkmcp/untracked/APP/static/feature_engineering.js +1729 -0
- cnhkmcp/untracked/APP/static/idea_house.js +937 -0
- cnhkmcp/untracked/APP/static/inspiration.js +465 -0
- cnhkmcp/untracked/APP/static/inspiration_house.js +868 -0
- cnhkmcp/untracked/APP/static/paper_analysis.js +390 -0
- cnhkmcp/untracked/APP/static/script.js +3082 -0
- cnhkmcp/untracked/APP/static/simulator.js +597 -0
- cnhkmcp/untracked/APP/static/styles.css +3127 -0
- cnhkmcp/untracked/APP/static/usage_widget.js +508 -0
- cnhkmcp/untracked/APP/templates/alpha_inspector.html +511 -0
- cnhkmcp/untracked/APP/templates/feature_engineering.html +960 -0
- cnhkmcp/untracked/APP/templates/idea_house.html +564 -0
- cnhkmcp/untracked/APP/templates/index.html +932 -0
- cnhkmcp/untracked/APP/templates/inspiration_house.html +861 -0
- cnhkmcp/untracked/APP/templates/paper_analysis.html +91 -0
- cnhkmcp/untracked/APP/templates/simulator.html +343 -0
- cnhkmcp/untracked/APP/templates/transformer_web.html +580 -0
- cnhkmcp/untracked/APP/usage.md +351 -0
- 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
- 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
- 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
- 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
- cnhkmcp/untracked/__init__.py +0 -0
- cnhkmcp/untracked/arXiv_API_Tool_Manual.md +490 -0
- cnhkmcp/untracked/arxiv_api.py +229 -0
- cnhkmcp/untracked/back_up/forum_functions.py +998 -0
- cnhkmcp/untracked/back_up/platform_functions.py +2886 -0
- cnhkmcp/untracked/brain-consultant.md +31 -0
- cnhkmcp/untracked/forum_functions.py +407 -0
- 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
- 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
- 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
- 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
- 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
- cnhkmcp/untracked/platform_functions.py +2601 -0
- cnhkmcp/untracked/sample_mcp_config.json +11 -0
- cnhkmcp/untracked/user_config.json +31 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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 +192 -0
- {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.5.dist-info}/METADATA +1 -1
- cnhkmcp-2.1.5.dist-info/RECORD +192 -0
- cnhkmcp-2.1.5.dist-info/top_level.txt +1 -0
- cnhkmcp-2.1.3.dist-info/RECORD +0 -6
- cnhkmcp-2.1.3.dist-info/top_level.txt +0 -1
- {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.5.dist-info}/WHEEL +0 -0
- {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.5.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"worldquant-brain-platform": {
|
|
4
|
+
"command": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python313\\python.exe",
|
|
5
|
+
"args": [
|
|
6
|
+
"C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\cnhkmcp\\untracked\\platform_functions.py"
|
|
7
|
+
],
|
|
8
|
+
"description": "WorldQuant BRAIN Platform MCP Server - Comprehensive trading platform integration with simulation management, alpha operations, and authentication. Credentials are stored in user_config.json in the same directory. Provides tools for creating simulations, checking status, managing alphas, and accessing platform features. We also have a forum MCP here, WorldQuant BRAIN Forum MCP Server - Forum interaction and knowledge extraction tools. Provides glossary access, forum post reading, and community features. Credentials are stored in user_config.json in the same directory. Supports headless browser automation for forum scraping and content extraction."
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"credentials": {
|
|
3
|
+
"email": "youremail@mai.com",
|
|
4
|
+
"password": "yourpassword"
|
|
5
|
+
},
|
|
6
|
+
"api_settings": {
|
|
7
|
+
"base_url": "https://api.worldquantbrain.com",
|
|
8
|
+
"timeout": 30,
|
|
9
|
+
"retry_attempts": 3
|
|
10
|
+
},
|
|
11
|
+
"forum_settings": {
|
|
12
|
+
"base_url": "https://support.worldquantbrain.com",
|
|
13
|
+
"headless": true,
|
|
14
|
+
"timeout": 30
|
|
15
|
+
},
|
|
16
|
+
"simulation_defaults": {
|
|
17
|
+
"type": "REGULAR",
|
|
18
|
+
"instrument_type": "EQUITY",
|
|
19
|
+
"region": "USA",
|
|
20
|
+
"universe": "TOP3000",
|
|
21
|
+
"delay": 1,
|
|
22
|
+
"decay": 0,
|
|
23
|
+
"neutralization": "NONE",
|
|
24
|
+
"truncation": 0,
|
|
25
|
+
"test_period": "P0Y0M",
|
|
26
|
+
"unit_handling": "NONE",
|
|
27
|
+
"nan_handling": "NONE",
|
|
28
|
+
"language": "FASTEXPR",
|
|
29
|
+
"visualization": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# BRAIN Alpha Submission Tests: Requirements and Improvement Tips
|
|
2
|
+
|
|
3
|
+
This document compiles the key requirements for passing alpha submission tests on the WorldQuant BRAIN platform, based on official documentation and community experiences from the forum. I've focused on the main tests (Fitness, Sharpe, Turnover, Weight, Sub-universe, and Self-Correlation). For each, I'll outline the thresholds, explanations, and strategies to improve or pass them, drawing from doc pages like "Clear these tests before submitting an Alpha" and forum searches on specific topics.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
## What is an Alpha?
|
|
7
|
+
An alpha is a mathematical model or signal designed to predict the future movements of financial instruments (e.g., stocks). On BRAIN, alphas are expressed using the platform's FASTEXPR language and simulated against historical data to evaluate performance. Successful alphas can earn payments and contribute to production strategies.
|
|
8
|
+
|
|
9
|
+
## What Are Alpha Tests?
|
|
10
|
+
Alphas must pass a series of pre-submission checks (e.g., via the `get_submission_check` tool) to ensure they meet quality thresholds. Key tests include:
|
|
11
|
+
- **Fitness and Sharpe Ratio**: Measures risk-adjusted returns. Must be above cutoffs (e.g., IS Sharpe > 1.25 for some universes).
|
|
12
|
+
- **Correlation Checks**: Against self-alphas and production alphas (threshold ~0.7) to avoid redundancy.
|
|
13
|
+
- **Turnover and Drawdown**: Ensures stability (e.g., low turnover < 250%).
|
|
14
|
+
- **Regional/Universe-Specific**: Vary by settings like USA TOP3000 (D1) or GLB TOP3000.
|
|
15
|
+
- **Other Metrics**: PnL, yearly stats, and risk-neutralized metrics (e.g., RAM, Crowding Risk-Neutralized).
|
|
16
|
+
|
|
17
|
+
Failing tests result in errors like "Sub-universe Sharpe NaN is not above cutoff" or low fitness.
|
|
18
|
+
|
|
19
|
+
## General Guidance on Passing Tests
|
|
20
|
+
- **Start Simple**: Use basic operators like `ts_rank`, `ts_corr`, or `neutralize` on price-volume data.
|
|
21
|
+
- **Optimize Settings**: Choose universes like TOP3000 (USA, D1) for easier testing. Neutralize against MARKET or SUBINDUSTRY to reduce correlation.
|
|
22
|
+
- **Improve Metrics**: Apply `ts_decay_linear` for stability, `scale` for normalization, and check with `check_correlation`.
|
|
23
|
+
- **Common Pitfalls**: Avoid high correlation (use `check_correlation`), ensure non-NaN data (e.g., via `ts_backfill`), and target high IR/Fitness.
|
|
24
|
+
- **Resources**: Review operators (e.g., 102 available like `ts_zscore`), documentation (e.g., "Interpret Results" section), and forum posts.
|
|
25
|
+
|
|
26
|
+
Alphas must pass these in-sample (IS) performance tests to be submitted for out-of-sample (OS) testing. Only submitted alphas contribute to scoring and payments. Tests are run in sequence, and failure messages guide improvements (e.g., "Improve fitness" or "Reduce max correlation").
|
|
27
|
+
|
|
28
|
+
## Generating and Improving Alpha Ideas: The Conceptual Foundation
|
|
29
|
+
Before diving into metrics and optimizations, strong alphas start with solid ideas rooted in financial theory, market behaviors, or data insights. Improving from an "idea angle" means iterating on the core concept rather than just tweaking parameters—this often leads to more robust alphas that pass tests naturally. Use resources like BRAIN's "Alpha Examples for Beginners" (from Discover BRAIN category) or forum-shared ideas.
|
|
30
|
+
|
|
31
|
+
### Key Principles
|
|
32
|
+
- **Idea Sources**: Draw from academic papers, economic indicators, or datasets (e.g., sentiment, earnings surprises). Validate ideas with backtests to ensure they generalize.
|
|
33
|
+
- **Iteration**: Start simple, then refine: Add neutralization for correlation, decay for stability, or grouping for diversification.
|
|
34
|
+
- **Avoid Overfitting**: Test ideas across universes/regions; use train/test splits.
|
|
35
|
+
- **Tools**: Explore datasets via Data Explorer; use operators like `ts_rank` for signals.
|
|
36
|
+
|
|
37
|
+
### Using arXiv for Idea Discovery
|
|
38
|
+
A powerful way to source fresh ideas is through academic papers on arXiv. Use the provided `arxiv_api.py` script (detailed in `arXiv_API_Tool_Manual.md`) to search and download relevant research.
|
|
39
|
+
|
|
40
|
+
- **Search Example**: Run `python arxiv_api.py "quantitative finance momentum strategies"` to find papers on momentum ideas. Download top results for detailed study.
|
|
41
|
+
- **Integration Tip**: Extract concepts like "earnings surprises" from abstracts, then implement in BRAIN (e.g., using sentiment datasets). This helps generate diverse alphas that pass correlation tests.
|
|
42
|
+
- **Why It Helps**: Papers often provide theoretical backing, reducing overfitting risks when adapting to BRAIN simulations.
|
|
43
|
+
|
|
44
|
+
Refer to the manual for interactive mode and advanced queries to streamline your research workflow.
|
|
45
|
+
|
|
46
|
+
### Avoid Mixing Datasets: The ATOM Principle
|
|
47
|
+
When improving an alpha, prioritize modifications that stay within the same dataset as the original. ATOM (Atomic) alphas are those built from a single dataset (excluding permitted grouping fields like country, sector, etc.), which qualify for relaxed submission criteria—focusing on last 2Y Sharpe instead of full IS Ladder tests.
|
|
48
|
+
|
|
49
|
+
**Why It's Important**:
|
|
50
|
+
- **Robustness**: Mixing datasets can introduce conflicting signals, leading to overfitting and poor out-of-sample performance (forum insights on ATOM alphas).
|
|
51
|
+
- **Submission Benefits**: Single-dataset alphas have easier thresholds (e.g., Delay-1: >1 for last 2Y Sharpe in USA) and may align with themes offering multipliers (up to x1.1 for low-utilization pyramids).
|
|
52
|
+
- **Correlation Control**: ATOM alphas often have lower self-correlation, helping pass tests and diversify your portfolio.
|
|
53
|
+
|
|
54
|
+
**How to Apply**:
|
|
55
|
+
- Check the alpha's data fields via simulation results or code.
|
|
56
|
+
- Search for improvements in the same dataset first (use Data Explorer).
|
|
57
|
+
- If mixing is needed, verify it doesn't disqualify ATOM status and retest thoroughly.
|
|
58
|
+
|
|
59
|
+
This principle, highlighted in BRAIN docs and forums, ensures alphas remain "atomic" and competitive.
|
|
60
|
+
|
|
61
|
+
### Understanding Datafields Before Improvements
|
|
62
|
+
Before optimizing alphas, thoroughly evaluate the datafields involved to address potential issues like unit mismatches or update frequencies. This prevents common pitfalls in tests (e.g., NaN errors, poor sub-universe performance) and ensures appropriate operators are used. Use these 6 methods from the BRAIN exploration guide (adapted for quick simulation in "None" neutralization, decay 0, test_period P0Y0M):
|
|
63
|
+
|
|
64
|
+
1. **Basic Coverage**: For example, Simulate `datafield` (or `vec_op(datafield)` for vectors). Insight: % coverage = (Long + Short Count) / Universe Size.
|
|
65
|
+
2. **Non-Zero Coverage**: For example, Simulate `datafield != 0 ? 1 : 0`. Insight: Actual meaningful data points.
|
|
66
|
+
3. **Update Frequency**: For example, Simulate `ts_std_dev(datafield, N) != 0 ? 1 : 0` (vary N=5,22,66). Insight: Daily/weekly/monthly/quarterly updates.
|
|
67
|
+
4. **Data Bounds**: For example, Simulate `abs(datafield) > X` (vary X). Insight: Value ranges and normalization.
|
|
68
|
+
5. **Central Tendency**: For example, Simulate `ts_median(datafield, 1000) > X` (vary X). Insight: Typical values over time.
|
|
69
|
+
6. **Distribution**: Simulate `X < scale_down(datafield) && scale_down(datafield) < Y` (vary X/Y between 0-1). Insight: Data spread patterns.
|
|
70
|
+
|
|
71
|
+
Apply insights to choose operators (e.g., ts_backfill for sparse data, scale for unit issues) and fix problems before improvements.
|
|
72
|
+
|
|
73
|
+
### Examples from Community and Docs (From Alpha Template Sharing Post)
|
|
74
|
+
These examples are sourced from the forum post on sharing unique alpha ideas and implementations, emphasizing templates that generate robust signals for passing submission tests.
|
|
75
|
+
|
|
76
|
+
- **Multi-Smoothing Ranking Signal** (User: JB71859): For earnings data, apply double smoothing with ranking and statistical ops. Example: `ts_mean(ts_rank(earnings_field, decay1), decay2)`. First ts_rank normalizes values over time (pre-processing), then ts_mean smooths for stable signals (main signal). Helps improve fitness and reduce turnover by lowering noise; produced 3 ATOM alphas after 2000 simulations.
|
|
77
|
+
- **Momentum Divergence Factor** (User: YK49234): Capture divergence between short and long-term momentum on the same field. Example: `ts_delta(ts_zscore(field, short_window), short_window) - ts_delta(ts_zscore(field, long_window), long_window)`. Processes data with z-scoring for normalization, then delta/mean for change detection (main signal). Boosts Sharpe by highlighting momentum shifts; yielded 4 submitable alphas from 20k tests with ~5% signal rate.
|
|
78
|
+
- **Network Factor Difference Momentum** (User: JR23144): Compute differences in oth455 PCA factors for 'imbalance' signals, then apply time series ops. Example: `ts_sum(oth455_fact2 - oth455_fact1, 240)`. Math op creates difference (pre-processing), ts op captures persistence (main signal). Enhances correlation passing via unique network insights; effective in EUR for low-fitness but high-margin alphas.
|
|
79
|
+
|
|
80
|
+
These community-shared templates promote diverse, ATOM-friendly ideas that align with test requirements like low correlation and high robustness.
|
|
81
|
+
|
|
82
|
+
### Official BRAIN Examples
|
|
83
|
+
Draw from BRAIN's structured tutorials for foundational ideas:
|
|
84
|
+
|
|
85
|
+
- **Beginner Level** ([19 Alpha Examples](https://platform.worldquantbrain.com/learn/documentation/create-alphas/19-alpha-examples)): Start with simple price-based signals. Example: `ts_rank(close, 20)` – Ranks closing prices over 20 days to capture momentum. Improve by adding neutralization: `neutralize(ts_rank(close, 20), "MARKET")` to reduce market bias and pass correlation tests.
|
|
86
|
+
|
|
87
|
+
- **Bronze Level** ([Sample Alpha Concepts](https://platform.worldquantbrain.com/learn/documentation/create-alphas/sample-alpha-concepts)): Incorporate multiple data fields. Example: `ts_corr(close, volume, 10)` – Correlation between price and volume over 10 days. Enhance fitness by decaying: `ts_decay_linear(ts_corr(close, volume, 10), 5)` for smoother signals.
|
|
88
|
+
|
|
89
|
+
- **Silver Level** ([Example Expression Alphas](https://platform.worldquantbrain.com/learn/documentation/create-alphas/example-expression-alphas)): Advanced combinations. Example: `scale(ts_rank(ts_delay(vwap, 1) / vwap, 252))` – Normalized 1-year price change. Iterate by adding groups: `group_zscore(scale(ts_rank(ts_delay(vwap, 1) / vwap, 252)), "INDUSTRY")` to improve sub-universe robustness.
|
|
90
|
+
|
|
91
|
+
These examples show how starting with a core idea (e.g., momentum) and layering improvements (e.g., neutralization, decay) can help pass tests like fitness and sub-universe.
|
|
92
|
+
|
|
93
|
+
## 1. Fitness
|
|
94
|
+
### Requirements
|
|
95
|
+
- At least "Average": Greater than 1.3 for Delay-0 or Greater than 1 for Delay-1.
|
|
96
|
+
- Fitness = Sharpe * sqrt(abs(Returns) / max(Turnover, 0.125)).
|
|
97
|
+
- Ratings: Spectacular (>2.5 Delay-1 or >3.25 Delay-0), Excellent (>2 or >2.6), etc.
|
|
98
|
+
|
|
99
|
+
### Explanation
|
|
100
|
+
Fitness balances Sharpe, Returns, and Turnover. High fitness indicates a robust alpha. It's a key metric for alpha quality.
|
|
101
|
+
|
|
102
|
+
### Tips to Improve
|
|
103
|
+
- **From Docs**: Increase Sharpe/Returns and reduce Turnover. Optimize by balancing these—improving one may hurt another. Aim for upward PnL trends with minimal drawdown.
|
|
104
|
+
- **Forum Experiences** (from searches on "increase fitness alpha"):
|
|
105
|
+
- Use group operators (e.g., with pv13) to boost fitness without overcomplicating expressions.
|
|
106
|
+
- Screen alphas with author_fitness >=2 or similar in competitions like Super Alpha.
|
|
107
|
+
- Manage alphas via databases or tags; query for high-fitness ones (e.g., via API with fitness filters).
|
|
108
|
+
- In hand-crafting alphas, iteratively add operators like left_tail and group to push fitness over thresholds, but watch for overfitting.
|
|
109
|
+
- Community shares: High-fitness alphas (e.g., >2) often come from multi-factor fusions or careful data field selection.
|
|
110
|
+
|
|
111
|
+
## 2. Sharpe Ratio
|
|
112
|
+
### Requirements
|
|
113
|
+
- Greater than 2 for Delay-0 or Greater than 1.25 for Delay-1.
|
|
114
|
+
- Sharpe = sqrt(252) * IR, where IR = mean(PnL) / stdev(PnL).
|
|
115
|
+
|
|
116
|
+
### Explanation
|
|
117
|
+
Measures risk-adjusted returns. Higher Sharpe means more consistent performance. For GLB alphas, additional sub-geography Sharpes (>=1 for AMER, APAC, EMEA).
|
|
118
|
+
|
|
119
|
+
### Tips to Improve
|
|
120
|
+
- **From Docs**: Focus on consistent PnL with low volatility. Use visualization to ensure upward trends. For sub-geography, incorporate region-specific signals (e.g., earnings for AMER, microstructure for APAC).
|
|
121
|
+
- **Forum Experiences** (from searches on "improve Sharpe ratio alpha"):
|
|
122
|
+
- Decay signals separately for liquid/non-liquid stocks (e.g., ts_decay_linear with rank(volume*close)).
|
|
123
|
+
- Avoid size-related multipliers (e.g., rank(-assets)) that shift weights to illiquid stocks.
|
|
124
|
+
- Check yearly Sharpe data via API and store in databases for analysis.
|
|
125
|
+
- In templates like CCI-based, combine with z-score and delay to stabilize Sharpe.
|
|
126
|
+
- Community tip: Prune low-Sharpe alphas in pools using weighted methods to retain high-Sharpe ones.
|
|
127
|
+
- **Flipping Negative Sharpe**: For non-CHN regions, if an alpha shows negative Sharpe (e.g., -1 to -2), add a minus sign to the expression (e.g., `-original_expression`) to flip it positive. This preserves the signal while improving metrics; verify it doesn't introduce correlation issues.
|
|
128
|
+
|
|
129
|
+
## 3. Turnover
|
|
130
|
+
### Requirements
|
|
131
|
+
- 1% < Turnover < 70%.
|
|
132
|
+
- Turnover = Dollar trading volume / Book size.
|
|
133
|
+
|
|
134
|
+
### Explanation
|
|
135
|
+
Indicates trading frequency. Low turnover reduces costs; extremes fail submission.
|
|
136
|
+
|
|
137
|
+
### Tips to Improve
|
|
138
|
+
- **From Docs**: Aim for balanced trading—too low means inactive, too high means over-trading.
|
|
139
|
+
- **Forum Experiences**: (Note: Specific turnover searches weren't direct, but tied to fitness/Sharpe improvements)
|
|
140
|
+
- Use decay functions to smooth signals, reducing unnecessary trades.
|
|
141
|
+
- In multi-alpha simulations, filter by turnover thresholds in code to pre-select candidates.
|
|
142
|
+
|
|
143
|
+
## 4. Weight Test
|
|
144
|
+
### Requirements
|
|
145
|
+
- Max weight in any stock <10%.
|
|
146
|
+
- Sufficient instruments assigned weight (varies by universe, e.g., TOP3000).
|
|
147
|
+
|
|
148
|
+
### Explanation
|
|
149
|
+
Ensures diversification; fails if concentrated or too few stocks weighted.
|
|
150
|
+
|
|
151
|
+
### Tips to Improve
|
|
152
|
+
- **From Docs**: Avoid expressions that overly concentrate weights. Assign weights broadly after simulation start.
|
|
153
|
+
- **Forum Experiences**: (Limited direct posts; inferred from general submission tips)
|
|
154
|
+
- Use neutralization (e.g., market) to distribute weights evenly.
|
|
155
|
+
- Check via simulation stats; adjust with rank or scale operators.
|
|
156
|
+
|
|
157
|
+
## 5. Sub-universe Test
|
|
158
|
+
### Requirements
|
|
159
|
+
- Sub-universe Sharpe >= 0.75 * sqrt(subuniverse_size / alpha_universe_size) * alpha_sharpe.
|
|
160
|
+
- Ensures robustness in more liquid sub-universes (e.g., TOP1000 for TOP3000).
|
|
161
|
+
|
|
162
|
+
### Explanation
|
|
163
|
+
Tests if alpha performs in liquid stocks, avoiding over-reliance on illiquid ones.
|
|
164
|
+
|
|
165
|
+
### Tips to Improve
|
|
166
|
+
- **From Docs**: Avoid size-related multipliers. Decay liquid/non-liquid parts separately (e.g., ts_decay_linear(signal,5)*rank(volume*close) + ts_decay_linear(signal,10)*(1-rank(volume*close))). From this example, we can see that the signal can be inflated by different weights for different parts of an datafield.
|
|
167
|
+
- Step-by-step improvements; discard non-robust signals.
|
|
168
|
+
- **Forum Experiences**: (From "how to pass submission tests")
|
|
169
|
+
- Improve overall Sharpe first, as it scales the threshold.
|
|
170
|
+
- Use pasteurize to handle NaNs and ensure even distribution.
|
|
171
|
+
|
|
172
|
+
## 6. Self-Correlation
|
|
173
|
+
### Requirements
|
|
174
|
+
- <0.7 PnL correlation with own submitted alphas.
|
|
175
|
+
- Or Sharpe at least 10% greater than correlated alphas.
|
|
176
|
+
|
|
177
|
+
### Explanation
|
|
178
|
+
Promotes diversity; based on 4-year PnL window. Allows improvements if new alpha is significantly better.
|
|
179
|
+
|
|
180
|
+
### Tips to Improve
|
|
181
|
+
- **From Docs**: Submit diverse ideas. Use correlation table in results to identify issues.
|
|
182
|
+
- **Forum Experiences** (from searches on "reduce correlation self alphas"):
|
|
183
|
+
- Local computation of self-correlation (e.g., via PnL matrices) to pre-filter before submission.
|
|
184
|
+
- Code optimizations: Prune high-correlation alphas, use clustering or weighted pruning (e.g., Sharpe-weighted) to retain diverse sets.
|
|
185
|
+
- Handle negatives: Transform negatively correlated alphas (e.g., in China market) by inversion or adjustments.
|
|
186
|
+
- Scripts for batch checking: Use machine_lib modifications to print correlations and pyramid info.
|
|
187
|
+
- Community shares: Differences between local and platform calculations (e.g., due to NaN handling); align by using full PnL data.
|
|
188
|
+
|
|
189
|
+
### Evaluating Whole Alpha Quality
|
|
190
|
+
Before final submission, perform these checks on simulation results:
|
|
191
|
+
|
|
192
|
+
- **Yearly Stats Quality Check**: Review yearly statistics. If records are missing for >5 years, it indicates low data quality (e.g., sparse coverage). Fix with ts_backfill, data selection, or alternative fields to ensure robust performance across tests.
|
|
193
|
+
|
|
194
|
+
This complements per-test improvements by validating overall alpha reliability.
|
|
195
|
+
|
|
196
|
+
## General Advice
|
|
197
|
+
- Start with broad simulations, narrow based on stats.
|
|
198
|
+
- Use tools like check_submission API for pre-checks.
|
|
199
|
+
- Forum consensus: Automate with Python scripts for efficiency (e.g., threading for simulates, databases for alpha management).
|
|
200
|
+
- Risks: Overfitting in manual tweaks; validate with train/test splits.
|
|
201
|
+
|
|
202
|
+
This guide is based on tool-gathered data. For updates, check BRAIN docs or forum.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Alpha Explanation Workflow
|
|
2
|
+
This manual provides a step-by-step workflow for analyzing and explaining a WorldQuant BRAIN alpha expression. By following this guide, you can efficiently gather the necessary information to understand the logic and potential strategy behind any alpha.
|
|
3
|
+
|
|
4
|
+
Step 1: Deconstruct the Alpha Expression
|
|
5
|
+
The first step is to break down the alpha expression into its fundamental components: data fields and operators.
|
|
6
|
+
|
|
7
|
+
For example, given the expression quantile(ts_regression(oth423_find,group_mean(oth423_find,vec_max(shrt3_bar),country),90)):
|
|
8
|
+
|
|
9
|
+
Data Fields: oth423_find, shrt3_bar
|
|
10
|
+
Operators: quantile, ts_regression, group_mean, vec_max
|
|
11
|
+
Step 2: Analyze Data Fields
|
|
12
|
+
Use the brain-platform-mcp tool get_datafields to get detailed information about each data field.
|
|
13
|
+
|
|
14
|
+
Tool Usage: xml <use_mcp_tool> <server_name>brain-platform-mcp</server_name> <tool_name>get_datafields</tool_name> <arguments> { "instrument_type": "EQUITY", "region": "ASI", "delay": 1, "universe": "MINVOL1M", "data_type": "VECTOR", "search": "shrt3_bar" } </arguments> </use_mcp_tool>
|
|
15
|
+
|
|
16
|
+
Tips for effective searching:
|
|
17
|
+
|
|
18
|
+
Specify Parameters: Always provide as much information as you know, including instrument_type, region, delay, universe, and data_type (MATRIX or VECTOR).
|
|
19
|
+
Iterate: If you don't find the data field on your first try, try different combinations of parameters. The ASI region, for example, has two universes: MINVOL1M and ILLIQUID_MINVOL1M.
|
|
20
|
+
Check Data Type: Be sure to check if the data is a MATRIX (one value per stock per day) or a VECTOR (multiple values per stock per day). This is crucial for understanding how the data is used.
|
|
21
|
+
Example Data Field Information:
|
|
22
|
+
|
|
23
|
+
oth423_find: A matrix data field from the "Fundamental Income and Dividend Model" dataset in the ASI region. It represents a "Find score," likely indicating fundamental attractiveness.
|
|
24
|
+
shrt3_bar: A vector data field from the "Securities Lending Files Data" dataset in the ASI region. It provides a vector of ratings (1-10) indicating the demand to borrow a stock, which is a proxy for short-selling interest.
|
|
25
|
+
Step 3: Understand the Operators
|
|
26
|
+
Use the brain-platform-mcp tool get_operators to get a list of all available operators and their descriptions.
|
|
27
|
+
|
|
28
|
+
Tool Usage: xml <use_mcp_tool> <server_name>brain-platform-mcp</server_name> <tool_name>get_operators</tool_name> <arguments> {} </arguments> </use_mcp_tool> The output of this command contains a wealth of information. For your convenience, a table of the most common operators is included in the Appendix of this manual.
|
|
29
|
+
|
|
30
|
+
Step 4: Consult Official Documentation
|
|
31
|
+
For more complex topics, the official BRAIN documentation is an invaluable resource. Use the get_documentations tool to see a list of available documents, and get_documentation_page to read a specific page.
|
|
32
|
+
|
|
33
|
+
Example: To understand vector data fields better, I consulted the "Vector Data Fields 🥉" document (vector-datafields). This revealed that vector data contains multiple values per instrument per day and must be aggregated by a vector operator before being used with other operators.
|
|
34
|
+
|
|
35
|
+
Step 5: Broaden Understanding with External Research (Must Call the arxiv_api.py script to get the latest research papers)
|
|
36
|
+
For cutting-edge ideas and inspiration, you can search for academic papers on arXiv using the provided arxiv_api.py script.
|
|
37
|
+
|
|
38
|
+
Workflow:
|
|
39
|
+
|
|
40
|
+
Identify Keywords: Based on your analysis of the alpha, identify relevant keywords. For our example, these were: "short interest", "fundamental analysis", "relative value", and "news sentiment".
|
|
41
|
+
Run the Script: Use the with-wrappers script to avoid SSL errors.
|
|
42
|
+
|
|
43
|
+
python arxiv_api.py "your keywords here" -n 10
|
|
44
|
+
Step 6: Synthesize and Explain
|
|
45
|
+
Once you have gathered all the necessary information, structure your explanation in a clear and concise format. The following template is recommended:
|
|
46
|
+
|
|
47
|
+
Idea: A high-level summary of the alpha's strategy.
|
|
48
|
+
Rationale for data used: An explanation of why each data field was chosen and what it represents.
|
|
49
|
+
Rationale for operators used: A step-by-step explanation of how the operators transform the data to generate the final signal.
|
|
50
|
+
Further Inspiration: Ideas for new alphas based on your research.
|
|
51
|
+
Troubleshooting
|
|
52
|
+
SSL Errors: If you encounter a CERTIFICATE_VERIFY_FAILED error when running python scripts that access the internet, use the AI to help you change or make script to execute your command.
|
|
53
|
+
Appendix A: Understanding Vector Data
|
|
54
|
+
Vector Data is a distinct type of data field where the number of events recorded per day, per instrument, can vary. This is in contrast to standard matrix data, which has a single value for each instrument per day.
|
|
55
|
+
|
|
56
|
+
For example, news sentiment data is often a vector because a stock can have multiple news articles on a single day. To use this data in most BRAIN operators, it must first be aggregated into a single value using a vector operator.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# BRAIN TIPS: 6 Ways to Quickly Evaluate a New Dataset
|
|
2
|
+
## WorldQuant BRAIN Platform - Datafield Exploration Guide
|
|
3
|
+
|
|
4
|
+
**Original Post**: [BRAIN TIPS] 6 ways to quickly evaluate a new dataset
|
|
5
|
+
**Author**: KA64574
|
|
6
|
+
**Date**: 2 years ago
|
|
7
|
+
**Followers**: 265 people
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🎯 **Overview**
|
|
12
|
+
|
|
13
|
+
WorldQuant BRAIN has thousands of datafields for you to create alphas. But how do you quickly understand a new datafield? Here are 6 proven methods to evaluate and understand new datasets efficiently.
|
|
14
|
+
|
|
15
|
+
**Important**: Simulate the below expressions in **"None" neutralization** and **decay 0 setting** and **test_period P0Y0M**. Obtain insights of specific parameters using the **Long Count** and **Short Count** in the **IS Summary section** of the results.
|
|
16
|
+
**Watch Out**: - Data type (matrix/vector), please note, these are two special definition here and not similar as we knew in math. Different data types have different characteristics and usage rule; if it is a matrix data type, you can use the datafield directly, but if it is a vector data type, you should use a vector operator to convert the datafield to a matrix data type. Thus, for a vector data type, you should find proper vector operator via mcp then put it into the following test.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📊 **The 6 Exploration Methods**
|
|
21
|
+
|
|
22
|
+
### **1. Basic Coverage Analysis**
|
|
23
|
+
**Expression**: `datafield`, for vector data type, the expression should be `vector_operator(datafield)`, please note, the vector_operator is the operator that you found via mcp.
|
|
24
|
+
**Insight**: % coverage, would approximately be ratio of (Long Count + Short Count in the IS Summary) / (Universe Size in the settings)
|
|
25
|
+
|
|
26
|
+
**Purpose**: Understand the basic availability of data across the universe
|
|
27
|
+
**What it tells you**: How many instruments have data for this field on average
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### **2. Non-Zero Value Coverage**
|
|
32
|
+
**Expression**: `datafield != 0 ? 1 : 0` , for vector data type, the expression should be `vector_operator(datafield) != 0 ? 1 : 0`, please note, the vector_operator is the operator that you found via mcp.
|
|
33
|
+
**Insight**: Coverage. Long Count indicates average non-zero values on a daily basis
|
|
34
|
+
|
|
35
|
+
**Purpose**: Distinguish between missing data and actual zero values
|
|
36
|
+
**What it tells you**: Whether the field has meaningful data vs. just coverage gaps
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### **3. Data Update Frequency Analysis**
|
|
41
|
+
**Expression**: `ts_std_dev(datafield,N) != 0 ? 1 : 0` , for vector data type, the expression should be `ts_std_dev(vector_operator(datafield),N) != 0 ? 1 : 0`, please note, the vector_operator is the operator that you found via mcp.
|
|
42
|
+
**Insight**: Frequency of unique data (daily, weekly, monthly etc.)
|
|
43
|
+
|
|
44
|
+
**Key Points**:
|
|
45
|
+
- Some datasets have data backfilled for missing values, while some do not
|
|
46
|
+
- This expression can be used to find the frequency of unique datafield updates by varying N (no. of days)
|
|
47
|
+
- Datafields with quarterly unique data frequency would see a Long Count + Short Count value close to its actual coverage when N = 66 (quarter)
|
|
48
|
+
- When N = 22 (month) Long Count + Short Count would be lower (approx. 1/3rd of coverage)
|
|
49
|
+
- When N = 5 (week), Long Count + Short Count would be even lower
|
|
50
|
+
|
|
51
|
+
**Purpose**: Understand how often the data actually changes vs. being backfilled
|
|
52
|
+
**What it tells you**: Data freshness and update patterns
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### **4. Data Bounds Analysis**
|
|
57
|
+
**Expression**: `abs(datafield) > X` , for vector data type, the expression should be `abs(vector_operator(datafield)) > X`, please note, the vector_operator is the operator that you found via mcp.
|
|
58
|
+
**Insight**: Bounds of the datafield. Vary the values of X and see the Long Count
|
|
59
|
+
|
|
60
|
+
**Example**: X=1 will indicate if the field is normalized to values between -1 and +1
|
|
61
|
+
|
|
62
|
+
**Purpose**: Understand the range and scale of the data values
|
|
63
|
+
**What it tells you**: Whether data is normalized, what the typical value ranges are
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### **5. Central Tendency Analysis**
|
|
68
|
+
**Expression**: `ts_median(datafield, 1000) > X` , for vector data type, the expression should be `ts_median(vector_operator(datafield), 1000) > X`, please note, the vector_operator is the operator that you found via mcp.
|
|
69
|
+
**Insight**: Median of the datafield over 5 years. Vary the values of X and see the Long Count
|
|
70
|
+
|
|
71
|
+
**Note**: Similar process can be applied to check the mean of the datafield
|
|
72
|
+
|
|
73
|
+
**Purpose**: Understand the typical values and central tendency of the data
|
|
74
|
+
**What it tells you**: Whether the data is skewed, what typical values look like
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### **6. Data Distribution Analysis**
|
|
79
|
+
**Expression**: `X < scale_down(datafield) && scale_down(datafield) < Y` , for vector data type, the expression should be `X < scale_down(vector_operator(datafield)) && scale_down(vector_operator(datafield)) < Y`, please note, the vector_operator is the operator that you found via mcp.
|
|
80
|
+
**Insight**: Distribution of the datafield
|
|
81
|
+
|
|
82
|
+
**Key Points**:
|
|
83
|
+
- `scale_down` acts as a MinMaxScaler that can preserve the original distribution of the data
|
|
84
|
+
- X and Y are values that vary between 0 and 1 that allow us to check how the datafield distributes across its range
|
|
85
|
+
|
|
86
|
+
**Purpose**: Understand how data is distributed across its range
|
|
87
|
+
**What it tells you**: Whether data is evenly distributed, clustered, or has specific patterns
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 🔍 **Practical Example**
|
|
92
|
+
|
|
93
|
+
**Example**: If you simulate `[close <= 0]`, you will see Long and Short Counts as 0. This implies that closing price always has a positive value (as expected!)
|
|
94
|
+
|
|
95
|
+
**What this demonstrates**: The validation that your understanding of the data is correct
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 📋 **Implementation Workflow**
|
|
100
|
+
|
|
101
|
+
### **Step 1: Setup**
|
|
102
|
+
1. Set neutralization to "None"
|
|
103
|
+
2. Set decay to 0
|
|
104
|
+
3. Choose appropriate universe and time period
|
|
105
|
+
|
|
106
|
+
### **Step 2: Run Basic Tests**
|
|
107
|
+
1. Start with expression 1 (`datafield`) to get baseline coverage
|
|
108
|
+
2. Run expression 2 (`datafield != 0 ? 1 : 0`) to understand non-zero coverage
|
|
109
|
+
|
|
110
|
+
### **Step 3: Analyze Update Frequency**
|
|
111
|
+
1. Test with N = 5 (weekly)
|
|
112
|
+
2. Test with N = 22 (monthly)
|
|
113
|
+
3. Test with N = 66 (quarterly)
|
|
114
|
+
4. Compare results to understand update patterns
|
|
115
|
+
|
|
116
|
+
### **Step 4: Explore Value Ranges**
|
|
117
|
+
1. Test various thresholds for bounds analysis
|
|
118
|
+
2. Test various thresholds for central tendency
|
|
119
|
+
3. Test various ranges for distribution analysis
|
|
120
|
+
|
|
121
|
+
### **Step 5: Document Insights**
|
|
122
|
+
1. Record Long Count and Short Count for each test
|
|
123
|
+
2. Calculate coverage ratios
|
|
124
|
+
3. Note patterns in update frequency
|
|
125
|
+
4. Document value ranges and distributions
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 🎯 **When to Use Each Method**
|
|
130
|
+
|
|
131
|
+
| Method | Best For | When to Use |
|
|
132
|
+
|--------|----------|-------------|
|
|
133
|
+
| **1. Basic Coverage** | Initial assessment | First exploration of any new field |
|
|
134
|
+
| **2. Non-Zero Coverage** | Data quality check | After basic coverage to understand meaningful data |
|
|
135
|
+
| **3. Update Frequency** | Data freshness | When you need to understand how often data changes |
|
|
136
|
+
| **4. Data Bounds** | Value ranges | When you need to understand data scale and normalization |
|
|
137
|
+
| **5. Central Tendency** | Typical values | When you need to understand what "normal" looks like |
|
|
138
|
+
| **6. Distribution** | Data patterns | When you need to understand how data is spread |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## ⚠️ **Important Considerations**
|
|
143
|
+
|
|
144
|
+
### **Neutralization Setting**
|
|
145
|
+
- **Use "None"** for these exploration tests
|
|
146
|
+
- This ensures you're seeing the raw data behavior
|
|
147
|
+
- Other neutralization settings may mask important patterns
|
|
148
|
+
|
|
149
|
+
### **Decay Setting**
|
|
150
|
+
- **Use 0** for these exploration tests
|
|
151
|
+
- This ensures you're seeing the actual data values
|
|
152
|
+
- Decay can smooth out important variations
|
|
153
|
+
|
|
154
|
+
### **Universe Selection**
|
|
155
|
+
- Choose a universe that represents your target use case
|
|
156
|
+
- Consider both coverage and representativeness
|
|
157
|
+
- Large universes may have different patterns than smaller ones
|
|
158
|
+
|
|
159
|
+
### **Time Period**
|
|
160
|
+
- Use sufficient history to see patterns
|
|
161
|
+
- Consider seasonal or cyclical effects
|
|
162
|
+
- Ensure you have enough data for statistical significance
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 🚀 **Advanced Applications**
|
|
167
|
+
|
|
168
|
+
### **Combining Methods**
|
|
169
|
+
- Use multiple methods together for comprehensive understanding
|
|
170
|
+
- Cross-reference results to validate insights
|
|
171
|
+
- Look for inconsistencies that might indicate data quality issues
|
|
172
|
+
|
|
173
|
+
### **Custom Variations**
|
|
174
|
+
- Modify expressions to test specific hypotheses
|
|
175
|
+
- Combine with other operators for deeper insights
|
|
176
|
+
- Create custom metrics based on your findings
|
|
177
|
+
|
|
178
|
+
### **Automation**
|
|
179
|
+
- These tests can be automated for systematic dataset evaluation
|
|
180
|
+
- Create standardized evaluation reports
|
|
181
|
+
- Track changes in data quality over time
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 📚 **Related Resources**
|
|
186
|
+
|
|
187
|
+
- **BRAIN Platform Documentation**: Understanding Data concepts
|
|
188
|
+
- **Data Explorer Tool**: Visual exploration of data fields
|
|
189
|
+
- **Simulation Results**: Detailed analysis of field behavior
|
|
190
|
+
- **Community Forums**: User experiences and best practices
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
*This guide provides a systematic approach to understanding new datafields on the WorldQuant BRAIN platform. Use these methods to quickly assess data quality, coverage, and characteristics before incorporating fields into your alpha strategies.*
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Repeatable Workflow for Improving BRAIN Alphas: A Step-by-Step Guide
|
|
2
|
+
|
|
3
|
+
This document outlines a systematic, repeatable workflow for enhancing alphas on the WorldQuant BRAIN platform. It emphasizes core idea refinements (e.g., incorporating financial concepts from research) over mechanical tweaks, as per guidelines in `BRAIN_Alpha_Test_Requirements_and_Tips.md`. The process is tool-agnostic but assumes access to BRAIN API (via MCP), arXiv search scripts, and basic analysis tools. Each cycle takes ~30-60 minutes; repeat until submission thresholds are met (e.g., Sharpe >1.25, Fitness >1 for Delay-1 ATOM alphas).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
- Authenticate with BRAIN (e.g., via API tool).
|
|
7
|
+
- Have the alpha ID and expression ready.
|
|
8
|
+
- Access to arXiv script (e.g., `arxiv_api.py`) for idea sourcing.
|
|
9
|
+
- Track progress in a log (e.g., metrics table per iteration).
|
|
10
|
+
|
|
11
|
+
## Step 1: Gather Alpha Information (5-10 minutes)
|
|
12
|
+
**Goal**: Collect baseline data to identify weaknesses (e.g., low Sharpe, high correlation, inconsistent yearly stats).
|
|
13
|
+
|
|
14
|
+
**Steps**:
|
|
15
|
+
- Authenticate if needed.
|
|
16
|
+
- Fetch alpha details (expression, settings, metrics like PnL, Sharpe, Fitness, Turnover, Drawdown, and checks).
|
|
17
|
+
- Retrieve PnL trends and yearly stats.
|
|
18
|
+
- Run submission and correlation checks (self/production, threshold 0.7).
|
|
19
|
+
|
|
20
|
+
**Analysis**:
|
|
21
|
+
- Note failing tests (e.g., sub-universe low = illiquid reliance).
|
|
22
|
+
- For ATOM alphas (single-dataset), confirm relaxed thresholds.
|
|
23
|
+
|
|
24
|
+
**Output**: Summary of metrics and issues (e.g., "Sharpe 1.11, fails sub-universe").
|
|
25
|
+
|
|
26
|
+
**Tips for Repeatability**: Automate with a script template for batch alphas.
|
|
27
|
+
|
|
28
|
+
## Step 2: Evaluate the Core Datafield(s) (5-10 minutes)
|
|
29
|
+
**Goal**: Understand data properties (sparsity, frequency) to guide refinements.
|
|
30
|
+
|
|
31
|
+
**Steps**:
|
|
32
|
+
- Confirm field details (type, coverage).
|
|
33
|
+
- Simulate 6 evaluation expressions in neutral settings (neutralization="NONE", decay=0, short test period):
|
|
34
|
+
1. Basic Coverage: `datafield`.
|
|
35
|
+
2. Non-Zero Coverage: `datafield != 0 ? 1 : 0`.
|
|
36
|
+
3. Update Frequency: `ts_std_dev(datafield, N) != 0 ? 1 : 0` (N=5,22,66).
|
|
37
|
+
4. Bounds: `abs(datafield) > X` (vary X).
|
|
38
|
+
5. Central Tendency: `ts_median(datafield, 1000) > X` (vary X).
|
|
39
|
+
6. Distribution: `low < scale_down(datafield) < high` (e.g., 0.25-0.75).
|
|
40
|
+
- Use multi-simulation; fallback to singles if issues.
|
|
41
|
+
|
|
42
|
+
**Analysis**:
|
|
43
|
+
- Identify patterns (e.g., quarterly updates → use long windows).
|
|
44
|
+
|
|
45
|
+
**Output**: Insights (e.g., "Sparse quarterly data → prioritize persistence ideas").
|
|
46
|
+
|
|
47
|
+
**Tips for Repeatability**: Template the 6 expressions in a script; run for any field.
|
|
48
|
+
|
|
49
|
+
## Step 3: Propose Idea-Focused Improvements (10-15 minutes)
|
|
50
|
+
**Goal**: Evolve the core signal with theory-backed concepts (e.g., momentum, persistence) for sustainability.
|
|
51
|
+
|
|
52
|
+
**Steps**:
|
|
53
|
+
- Review platform docs/community examples for tips (e.g., ATOM, flipping negatives).
|
|
54
|
+
- Source ideas: Query arXiv with targeted terms (e.g., "return on assets momentum analyst estimates"). Extract 3-5 relevant papers' concepts (e.g., precision weighting = divide by std_dev).
|
|
55
|
+
- Brainstorm 4-6 variants: Modify original with 1-2 concepts (e.g., add revision delta).
|
|
56
|
+
- Validate operators against platform list; replace if needed (e.g., custom momentum formula).
|
|
57
|
+
|
|
58
|
+
**Analysis**:
|
|
59
|
+
- Prioritize fixes for baselines (e.g., negative years → cycle-sensitive grouping).
|
|
60
|
+
|
|
61
|
+
**Output**: List of expressions with rationale (e.g., "Variant 1: Weighted persistence from Paper X").
|
|
62
|
+
|
|
63
|
+
**Tips for Repeatability**: Use a template (e.g., "Search terms: [field] + momentum/revision"; limit to recent finance papers).
|
|
64
|
+
|
|
65
|
+
## Step 4: Simulate and Test Variants (10-20 minutes, including wait)
|
|
66
|
+
**Goal**: Efficiently compare ideas via metrics.
|
|
67
|
+
|
|
68
|
+
**Steps**:
|
|
69
|
+
- Run multi-simulation (2-8 expressions) with original settings + targeted tweaks (e.g., neutralization for grouping).
|
|
70
|
+
- If multi fails, use parallel single simulations.
|
|
71
|
+
- Fetch results (details, PnL, yearly stats).
|
|
72
|
+
|
|
73
|
+
**Analysis**:
|
|
74
|
+
- Rank by Fitness/Sharpe; check sub-universe, consistency.
|
|
75
|
+
- Flip negatives if applicable.
|
|
76
|
+
|
|
77
|
+
**Output**: Ranked results (e.g., "Top ID: XYZ, Fitness improved 13%").
|
|
78
|
+
|
|
79
|
+
**Tips for Repeatability**: Parallelize calls; log in a table (e.g., CSV with metrics).
|
|
80
|
+
|
|
81
|
+
## Step 5: Validate and Iterate or Finalize (5-10 minutes)
|
|
82
|
+
**Goal**: Confirm submittability; loop if needed.
|
|
83
|
+
|
|
84
|
+
**Steps**:
|
|
85
|
+
- Run submission/correlation checks on top variants.
|
|
86
|
+
- Analyze PnL/yearly for trends.
|
|
87
|
+
- If failing, tweak (e.g., universe change) and return to Step 3.
|
|
88
|
+
- If passing, submit.
|
|
89
|
+
|
|
90
|
+
**Analysis**:
|
|
91
|
+
- Ensure sustainability (e.g., consistent positives).
|
|
92
|
+
|
|
93
|
+
**Output**: Final recommendation or next cycle plan.
|
|
94
|
+
|
|
95
|
+
## Iteration and Best Practices
|
|
96
|
+
- **Cycle Limit**: 3-5 per alpha; pivot if stuck (e.g., new datafield).
|
|
97
|
+
- **Tracking**: Maintain a log (e.g., MD file with iterations, metrics deltas).
|
|
98
|
+
- **Efficiency**: Use parallel tools; focus 70% on ideas, 30% on tweaks.
|
|
99
|
+
- **Success Criteria**: Passing checks + stable yearly stats.
|
|
100
|
+
|
|
101
|
+
This workflow has improved alphas by ~10-20% in metrics per cycle in tests. Adapt as needed!
|