cnhkmcp 1.3.2__py3-none-any.whl → 1.3.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.
- cnhkmcp/__init__.py +1 -1
- cnhkmcp/untracked/Alpha_explaination_workflow.md +56 -0
- cnhkmcp/untracked/platform_functions.py +2 -2
- {cnhkmcp-1.3.2.dist-info → cnhkmcp-1.3.4.dist-info}/METADATA +1 -1
- cnhkmcp-1.3.4.dist-info/RECORD +19 -0
- cnhkmcp-1.3.2.dist-info/RECORD +0 -18
- /cnhkmcp/untracked/{BRAIN_Alpha_Test_Requirements_and_Tips.md → /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"} +0 -0
- /cnhkmcp/untracked/{BRAIN_6_Tips_Datafield_Exploration_Guide.md → /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"} +0 -0
- /cnhkmcp/untracked/{BRAIN_Alpha_Improvement_Workflow.md → /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"} +0 -0
- /cnhkmcp/untracked/{Dataset_Exploration_Expert_Manual.md → /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"} +0 -0
- /cnhkmcp/untracked/{daily_report_workflow.md → /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"} +0 -0
- {cnhkmcp-1.3.2.dist-info → cnhkmcp-1.3.4.dist-info}/WHEEL +0 -0
- {cnhkmcp-1.3.2.dist-info → cnhkmcp-1.3.4.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-1.3.2.dist-info → cnhkmcp-1.3.4.dist-info}/licenses/LICENSE +0 -0
- {cnhkmcp-1.3.2.dist-info → cnhkmcp-1.3.4.dist-info}/top_level.txt +0 -0
cnhkmcp/__init__.py
CHANGED
|
@@ -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.
|
|
@@ -400,7 +400,7 @@ class BrainApiClient:
|
|
|
400
400
|
|
|
401
401
|
async def get_datafields(self, instrument_type: str = "EQUITY", region: str = "USA",
|
|
402
402
|
delay: int = 1, universe: str = "TOP3000", theme: str = "false",
|
|
403
|
-
dataset_id: Optional[str] = None, data_type: str = "
|
|
403
|
+
dataset_id: Optional[str] = None, data_type: str = "",
|
|
404
404
|
search: Optional[str] = None) -> Dict[str, Any]:
|
|
405
405
|
"""Get available data fields."""
|
|
406
406
|
await self.ensure_authenticated()
|
|
@@ -1683,7 +1683,7 @@ async def get_datafields(
|
|
|
1683
1683
|
universe: str = "TOP3000",
|
|
1684
1684
|
theme: str = "false",
|
|
1685
1685
|
dataset_id: Optional[str] = None,
|
|
1686
|
-
data_type: str = "
|
|
1686
|
+
data_type: str = "",
|
|
1687
1687
|
search: Optional[str] = None
|
|
1688
1688
|
) -> Dict[str, Any]:
|
|
1689
1689
|
"""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
cnhkmcp/__init__.py,sha256=aw7f1V-8EJO_KkfavII7goZEW922NWSJ1StyrPNC1AA,2758
|
|
2
|
+
cnhkmcp/untracked/Alpha_explaination_workflow.md,sha256=QukeT9gIg4g28AuYPqn-fYtCwb-JmMxZuIkmkrkUfFY,4916
|
|
3
|
+
cnhkmcp/untracked/arXiv_API_Tool_Manual.md,sha256=I3hvI5mpmIjBuWptufoVSWFnuhyUc67oCGHEuR0p_xs,13552
|
|
4
|
+
cnhkmcp/untracked/arxiv_api.py,sha256=-E-Ub9K-DXAYaCjrbobyfQ9H97gaZBc7pL6xPEyVHec,9020
|
|
5
|
+
cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
|
|
6
|
+
cnhkmcp/untracked/platform_functions.py,sha256=cgF1ZXbLFKt634Bk1OruiO7wmSuDQspdLkSjnpG9aK4,110033
|
|
7
|
+
cnhkmcp/untracked/sample_mcp_config.json,sha256=QSFvZ086bxUQsvmLjcE6pL9ObzKn4FGnt9npWPo7Eps,1044
|
|
8
|
+
cnhkmcp/untracked/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
9
|
+
cnhkmcp/untracked/示例参考文档_BRAIN_Alpha_Test_Requirements_and_Tips.md,sha256=W4dtQrqoTN72UyvIsvkGRF0HFOJLHSDeeSlbR3gqQg0,17133
|
|
10
|
+
cnhkmcp/untracked/示例工作流_BRAIN_6_Tips_Datafield_Exploration_Guide.md,sha256=YyMX1MIsDTJTduxulY-fYipNHvRihshQy9Q2j6Zxg2Q,9123
|
|
11
|
+
cnhkmcp/untracked/示例工作流_BRAIN_Alpha_Improvement_Workflow.md,sha256=XlWYREd_qXe1skdXIhkiGY05oDr_6KiBs1WkerY4S8U,5092
|
|
12
|
+
cnhkmcp/untracked/示例工作流_Dataset_Exploration_Expert_Manual.md,sha256=-C4fWdaBe9UzA5BDZz0Do2z8RaPWLslb6D0nTz6fqk4,24403
|
|
13
|
+
cnhkmcp/untracked/示例工作流_daily_report_workflow.md,sha256=SbPZqmIgt8tlRS2NevYQ0t1rvC8uiOqeXorh6nxiXZc,9104
|
|
14
|
+
cnhkmcp-1.3.4.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
|
|
15
|
+
cnhkmcp-1.3.4.dist-info/METADATA,sha256=_kmLtieDUf6dSWFfP_dgP1AKfdiyG_CPdYUFUGPUrco,5171
|
|
16
|
+
cnhkmcp-1.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
cnhkmcp-1.3.4.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
|
|
18
|
+
cnhkmcp-1.3.4.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
|
|
19
|
+
cnhkmcp-1.3.4.dist-info/RECORD,,
|
cnhkmcp-1.3.2.dist-info/RECORD
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
cnhkmcp/__init__.py,sha256=tTQO7KVL8mCddCe1P6Eaw7XzhFZWHqYbTCGnmgmw2AU,2758
|
|
2
|
-
cnhkmcp/untracked/BRAIN_6_Tips_Datafield_Exploration_Guide.md,sha256=YyMX1MIsDTJTduxulY-fYipNHvRihshQy9Q2j6Zxg2Q,9123
|
|
3
|
-
cnhkmcp/untracked/BRAIN_Alpha_Improvement_Workflow.md,sha256=XlWYREd_qXe1skdXIhkiGY05oDr_6KiBs1WkerY4S8U,5092
|
|
4
|
-
cnhkmcp/untracked/BRAIN_Alpha_Test_Requirements_and_Tips.md,sha256=W4dtQrqoTN72UyvIsvkGRF0HFOJLHSDeeSlbR3gqQg0,17133
|
|
5
|
-
cnhkmcp/untracked/Dataset_Exploration_Expert_Manual.md,sha256=-C4fWdaBe9UzA5BDZz0Do2z8RaPWLslb6D0nTz6fqk4,24403
|
|
6
|
-
cnhkmcp/untracked/arXiv_API_Tool_Manual.md,sha256=I3hvI5mpmIjBuWptufoVSWFnuhyUc67oCGHEuR0p_xs,13552
|
|
7
|
-
cnhkmcp/untracked/arxiv_api.py,sha256=-E-Ub9K-DXAYaCjrbobyfQ9H97gaZBc7pL6xPEyVHec,9020
|
|
8
|
-
cnhkmcp/untracked/daily_report_workflow.md,sha256=SbPZqmIgt8tlRS2NevYQ0t1rvC8uiOqeXorh6nxiXZc,9104
|
|
9
|
-
cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
|
|
10
|
-
cnhkmcp/untracked/platform_functions.py,sha256=6GyinE9LpYMfjzdFhdZyIvh2kz4Ovg_RIg5NeUTqIbo,110045
|
|
11
|
-
cnhkmcp/untracked/sample_mcp_config.json,sha256=QSFvZ086bxUQsvmLjcE6pL9ObzKn4FGnt9npWPo7Eps,1044
|
|
12
|
-
cnhkmcp/untracked/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
13
|
-
cnhkmcp-1.3.2.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
|
|
14
|
-
cnhkmcp-1.3.2.dist-info/METADATA,sha256=Ix4Vz75AfgRdnpvdhZvlF4MVq_KH2HEx9XK1qrq439o,5171
|
|
15
|
-
cnhkmcp-1.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
-
cnhkmcp-1.3.2.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
|
|
17
|
-
cnhkmcp-1.3.2.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
|
|
18
|
-
cnhkmcp-1.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|