easyquant-research 0.1.0__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.
- easyquant_research/__init__.py +12 -0
- easyquant_research/_data/catalog/fields.json +72 -0
- easyquant_research/_data/catalog/functions.json +25 -0
- easyquant_research/_data/catalog/indicators.json +4580 -0
- easyquant_research/_data/catalog/markets.json +155 -0
- easyquant_research/_data/catalog/rule-nodes.json +20 -0
- easyquant_research/_data/catalog/tools.json +197 -0
- easyquant_research/_data/docs/BOUNDARIES.md +40 -0
- easyquant_research/_data/docs/EXPRESSION.md +70 -0
- easyquant_research/_data/docs/MARKETS.md +33 -0
- easyquant_research/_data/docs/RUNTIME_MCP.md +75 -0
- easyquant_research/_data/docs/TIMING_DSL.md +49 -0
- easyquant_research/_data/docs/WORKFLOW.md +57 -0
- easyquant_research/_data/examples/artifact-ema-cross.json +28 -0
- easyquant_research/_data/examples/factor-report.json +8 -0
- easyquant_research/_data/examples/portfolio-etf.json +13 -0
- easyquant_research/_data/examples/portfolio-momentum.json +13 -0
- easyquant_research/_data/examples/screen-value.json +11 -0
- easyquant_research/_data/examples/timing-ema-cross.json +14 -0
- easyquant_research/_data/examples/timing-future-longshort.json +15 -0
- easyquant_research/_data/skills/easyquant-expression/SKILL.md +87 -0
- easyquant_research/_data/skills/easyquant-research/SKILL.md +107 -0
- easyquant_research/_resources.py +67 -0
- easyquant_research/cli.py +413 -0
- easyquant_research/client.py +187 -0
- easyquant_research/mcp_server.py +303 -0
- easyquant_research/reference.py +174 -0
- easyquant_research-0.1.0.dist-info/METADATA +232 -0
- easyquant_research-0.1.0.dist-info/RECORD +32 -0
- easyquant_research-0.1.0.dist-info/WHEEL +4 -0
- easyquant_research-0.1.0.dist-info/entry_points.txt +3 -0
- easyquant_research-0.1.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""EasyQuant Research: open-source MCP connector and Agent Skills for the EasyQuant research engine.
|
|
2
|
+
|
|
3
|
+
The engine and its data stay hosted; this package open-sources the client side — a stdio MCP
|
|
4
|
+
server (offline reference tools + a bridge to the hosted research MCP), a CLI, and installable
|
|
5
|
+
Agent Skills. Every tool is historical research only: no orders, no live trading, no fund
|
|
6
|
+
accounts, no API-key management.
|
|
7
|
+
"""
|
|
8
|
+
from ._resources import data_root, load_tools
|
|
9
|
+
from .client import Client, ResearchError
|
|
10
|
+
|
|
11
|
+
__all__ = ["Client", "ResearchError", "data_root", "load_tools"]
|
|
12
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"how": "表达式对每只股票、每个交易日算出一个值。条件:非 0 即入选;排序:按数值排。「且」用 *,「或」用 MAX(a, b),条件分支用 IF(条件, 值1, 值2)。字段名小写、函数名大写;不支持字符串、下标、属性访问和横截面 RANK。全局因子(Barra 风格与本土因子)写 gf_<代码小写>(原值)或 gfpct_<代码小写>(当天全市场百分位 0~1);★ 本土因子(龙虎榜、涨停、资金流、形态命中等)只存当天前 200 或命中的股票,没进榜是空值,适合当条件(如 gf_lhb_net_buy_5d > 0),不适合在全市场排序。",
|
|
3
|
+
"markets": {
|
|
4
|
+
"cn_stock": {
|
|
5
|
+
"name": "A 股",
|
|
6
|
+
"fields": [
|
|
7
|
+
{ "group": "价量", "names": "open high low close volume", "note": "已前复权;volume 单位手" },
|
|
8
|
+
{ "group": "价量", "names": "amount", "note": "成交额,元" },
|
|
9
|
+
{ "group": "价量", "names": "raw_open raw_high raw_low raw_close raw_volume", "note": "不复权原值;「股价低于 10 元」用 raw_close" },
|
|
10
|
+
{ "group": "估值", "names": "pe pe_ttm pb ps ps_ttm", "note": "倍;亏损公司 pe / pe_ttm 为空,低估值条件要加 pe_ttm > 0" },
|
|
11
|
+
{ "group": "股息", "names": "dv_ratio dv_ttm", "note": "股息率 %,3 表示 3%" },
|
|
12
|
+
{ "group": "市值股本", "names": "total_mv circ_mv", "note": "万元:100 亿元写 1e6" },
|
|
13
|
+
{ "group": "市值股本", "names": "total_share float_share free_share", "note": "万股" },
|
|
14
|
+
{ "group": "交易", "names": "turnover_rate turnover_rate_f volume_ratio", "note": "换手率 %,量比倍数" },
|
|
15
|
+
{ "group": "财务指标", "names": "roe_yearly roa_yearly roic_yearly grossprofit_margin netprofit_margin debt_to_assets current_ratio quick_ratio netprofit_yoy or_yoy tr_yoy q_roe q_netprofit_yoy q_sales_yoy eps bps cfps", "note": "比率类为 %。★ roe 是报告期累计值,一季报只含一个季度,按年比较用 roe_yearly" },
|
|
16
|
+
{ "group": "利润表", "names": "inc_<科目> / incq_<科目> / incttm_<科目>,例如 incttm_n_income_attr_p、incq_revenue", "note": "年初累计 / 单季 / 近四季合计(TTM),元;科目沿用 Tushare income 表字段名" },
|
|
17
|
+
{ "group": "资产负债表", "names": "bs_<科目>,例如 bs_total_assets、bs_money_cap", "note": "期末值,元" },
|
|
18
|
+
{ "group": "现金流量表", "names": "cf_<科目> / cfq_<科目> / cfttm_<科目>,例如 cfttm_n_cashflow_act", "note": "同利润表口径" },
|
|
19
|
+
{ "group": "过滤", "names": "nonfin", "note": "非金融公司为 1,银行、保险、证券为空;乘上它剔除金融股" },
|
|
20
|
+
{ "group": "指数", "names": "bench_close sh_close(及 _open/_high/_low/_vol/_amount)", "note": "沪深 300 / 上证指数,所有股票同一条序列" },
|
|
21
|
+
{ "group": "派生", "names": "ret1", "note": "当日涨跌幅(比例)" }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"cn_etf": {
|
|
25
|
+
"name": "场内 ETF",
|
|
26
|
+
"fields": [
|
|
27
|
+
{ "group": "价量", "names": "open high low close volume", "note": "已前复权;volume 单位手" },
|
|
28
|
+
{ "group": "价量", "names": "amount", "note": "成交额,元:日均成交额 1 亿元以上写 MA(amount, 20) > 1e8" },
|
|
29
|
+
{ "group": "价量", "names": "raw_open raw_high raw_low raw_close raw_volume", "note": "不复权原值" },
|
|
30
|
+
{ "group": "份额规模", "names": "fund_share", "note": "基金份额,万份;份额变化率如 fund_share / REF(fund_share, 20) - 1 反映申赎资金流向" },
|
|
31
|
+
{ "group": "份额规模", "names": "scale", "note": "基金规模(份额 × 收盘价),元:规模 2 亿元以上写 scale > 2e8" },
|
|
32
|
+
{ "group": "指数", "names": "bench_close sh_close(及 _open/_high/_low/_vol/_amount)", "note": "沪深 300 / 上证指数" },
|
|
33
|
+
{ "group": "派生", "names": "ret1", "note": "当日涨跌幅(比例)" }
|
|
34
|
+
],
|
|
35
|
+
"not_available": "估值、股息、市值、财务、全局因子(gf_ / gfpct_)都是股票数据,ETF 上不能用;规模用 scale"
|
|
36
|
+
},
|
|
37
|
+
"us_equity": {
|
|
38
|
+
"name": "美股",
|
|
39
|
+
"fields": [
|
|
40
|
+
{ "group": "价量", "names": "open high low close volume", "note": "已前复权(拆股、分红);volume 单位股" },
|
|
41
|
+
{ "group": "价量", "names": "amount", "note": "成交额,美元:日均 5000 万写 MA(amount, 20) > 5e7" },
|
|
42
|
+
{ "group": "价量", "names": "raw_open raw_high raw_low raw_close raw_volume", "note": "不复权原值" },
|
|
43
|
+
{ "group": "派生", "names": "ret1", "note": "当日涨跌幅(比例)" }
|
|
44
|
+
],
|
|
45
|
+
"not_available": "估值、财务、全局因子(gf_ / gfpct_)、A 股指数字段(bench_ / sh_)"
|
|
46
|
+
},
|
|
47
|
+
"hk_stock": {
|
|
48
|
+
"name": "港股",
|
|
49
|
+
"fields": [
|
|
50
|
+
{ "group": "价量", "names": "open high low close volume", "note": "已前复权(拆股、分红);volume 单位股" },
|
|
51
|
+
{ "group": "价量", "names": "amount", "note": "成交额,港元:日均 5000 万写 MA(amount, 20) > 5e7" },
|
|
52
|
+
{ "group": "价量", "names": "raw_open raw_high raw_low raw_close raw_volume", "note": "不复权原值" },
|
|
53
|
+
{ "group": "派生", "names": "ret1", "note": "当日涨跌幅(比例)" }
|
|
54
|
+
],
|
|
55
|
+
"not_available": "估值、财务、全局因子(gf_ / gfpct_)、A 股指数字段(bench_ / sh_)"
|
|
56
|
+
},
|
|
57
|
+
"cn_future": {
|
|
58
|
+
"name": "期货",
|
|
59
|
+
"fields": [
|
|
60
|
+
{ "group": "价量", "names": "open high low close volume", "note": "主力连续,已换月前复权;volume 单位手" },
|
|
61
|
+
{ "group": "价量", "names": "amount", "note": "成交额,元:日均 50 亿元写 MA(amount, 20) > 5e9" },
|
|
62
|
+
{ "group": "派生", "names": "ret1", "note": "当日涨跌幅(比例)" }
|
|
63
|
+
],
|
|
64
|
+
"not_available": "估值、财务、全局因子;只有价量字段。品种列表见运行时 catalog 的 markets[cn_future].varieties"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"global_factors": {
|
|
68
|
+
"how": "gf_<代码小写> 取原值,gfpct_<代码小写> 取当天全市场百分位(0~1)。",
|
|
69
|
+
"note": "本土因子(龙虎榜、涨停、资金流、形态命中等)只存当天前 200 或命中的股票,没进榜是空值,适合当条件,不适合在全市场排序。",
|
|
70
|
+
"live": "完整可用因子列表、分类与套餐锁定随用户而变,见运行时 catalog 的 expression.global_factors;本离线目录不写死因子清单。"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"how": "字段名小写、函数名大写。表达式不支持字符串、下标、属性访问和横截面 RANK;「且」用 *,「或」用 MAX(a, b),条件分支用 IF(条件, 值1, 值2),空值用 np.nan。",
|
|
3
|
+
"functions": [
|
|
4
|
+
{ "signature": "MA(x, n) / SMA / EMA(x, n)", "summary": "均线" },
|
|
5
|
+
{ "signature": "STD(x, n) / SUM(x, n) / MEAN(x, n)", "summary": "滚动标准差、求和、均值" },
|
|
6
|
+
{ "signature": "REF(x, n) / DELAY(x, n)", "summary": "n 天前的值" },
|
|
7
|
+
{ "signature": "DELTA(x, n)", "summary": "x - REF(x, n)" },
|
|
8
|
+
{ "signature": "HHV(x, n) / LLV(x, n)", "summary": "n 天最高 / 最低" },
|
|
9
|
+
{ "signature": "TS_RANK(x, n)", "summary": "当天值在自己近 n 天里的百分位" },
|
|
10
|
+
{ "signature": "ZSCORE(x, n)", "summary": "自己近 n 天的时序标准分" },
|
|
11
|
+
{ "signature": "RSI(x, n) / ATR(high, low, close, n) / ADX(high, low, close, n) / CCI(high, low, close, n) / OBV(close, volume)", "summary": "技术指标" },
|
|
12
|
+
{ "signature": "CORR(x, y, n) / COV(x, y, n)", "summary": "滚动相关 / 协方差" },
|
|
13
|
+
{ "signature": "DECAY_LINEAR(x, n) / MAX_DRAWDOWN(x, n)", "summary": "线性衰减加权 / 滚动最大回撤" },
|
|
14
|
+
{ "signature": "CROSS(a, b)", "summary": "当天 a 上穿 b 为 1" },
|
|
15
|
+
{ "signature": "EVERY(cond, n)", "summary": "连续 n 天都满足为 1" },
|
|
16
|
+
{ "signature": "IF(cond, a, b)", "summary": "条件分支;np.nan 表示空值" },
|
|
17
|
+
{ "signature": "ABS / LOG / SQRT / MAX(a, b) / MIN(a, b)", "summary": "数学函数" }
|
|
18
|
+
],
|
|
19
|
+
"examples": [
|
|
20
|
+
{ "idea": "ROE 大于 15% 且站上 60 日线", "condition": "(roe_yearly > 15) * (close > MA(close, 60))" },
|
|
21
|
+
{ "idea": "市盈率 15 倍以下、股息率 3% 以上", "condition": "(pe_ttm > 0) * (pe_ttm < 15) * (dv_ttm > 3)" },
|
|
22
|
+
{ "idea": "流通市值 50 亿到 300 亿", "condition": "(circ_mv > 5e5) * (circ_mv < 3e6)" },
|
|
23
|
+
{ "idea": "近 20 日涨幅最大的 30 只", "rank_by": "close / REF(close, 20) - 1", "top_n": "30" }
|
|
24
|
+
]
|
|
25
|
+
}
|