Skip to main content
GET
/
v1
/
quant
/
factors
List available factors
curl --request GET \
  --url https://api.reportify.cn/v1/quant/factors \
  --header 'Authorization: Bearer <token>'
[
  {
    "name": "<string>",
    "type": "<string>",
    "level": 123,
    "description": "<string>"
  }
]
获取所有可用的因子(变量和函数)定义,用于公式计算。
curl https://api.reportify.cn/v1/quant/factors \
  -H "Authorization: Bearer <token>"

响应参数

返回 FactorMeta[] 数组,因子列表按 level 分类。

响应示例

[
  {
    "name": "CLOSE",
    "type": "variable",
    "level": 0,
    "description": "收盘价"
  },
  {
    "name": "OPEN",
    "type": "variable",
    "level": 0,
    "description": "开盘价"
  },
  {
    "name": "HIGH",
    "type": "variable",
    "level": 0,
    "description": "最高价"
  },
  {
    "name": "LOW",
    "type": "variable",
    "level": 0,
    "description": "最低价"
  },
  {
    "name": "VOLUME",
    "type": "variable",
    "level": 0,
    "description": "成交量"
  },
  {
    "name": "MA",
    "type": "function",
    "level": 0,
    "description": "简单移动平均"
  },
  {
    "name": "EMA",
    "type": "function",
    "level": 0,
    "description": "指数移动平均"
  },
  {
    "name": "CROSS",
    "type": "function",
    "level": 1,
    "description": "上穿信号"
  },
  {
    "name": "RSI",
    "type": "function",
    "level": 2,
    "description": "相对强弱指数"
  },
  {
    "name": "MACD",
    "type": "function",
    "level": 2,
    "description": "指数平滑异同移动平均"
  }
]

因子分类

Level 0 - 变量

名称别名描述
CLOSEC收盘价
OPENO开盘价
HIGHH最高价
LOWL最低价
VOLUMEV, VOL成交量

Level 0 - 基础函数

函数描述示例
MA(N)N 日简单移动平均MA(20)
EMA(N)N 日指数移动平均EMA(12)
SMA(N, M)平滑移动平均SMA(9, 1)
REF(X, N)引用 N 天前的值REF(CLOSE, 1)
HHV(X, N)N 周期最高值HHV(HIGH, 20)
LLV(X, N)N 周期最低值LLV(LOW, 20)
STD(X, N)N 周期标准差STD(CLOSE, 20)
SUM(X, N)N 周期求和SUM(VOLUME, 5)
ABS(X)绝对值ABS(CLOSE - OPEN)
MAX(X, Y)取最大值MAX(CLOSE, OPEN)
MIN(X, Y)取最小值MIN(CLOSE, OPEN)
IF(C, A, B)条件选择IF(CLOSE > OPEN, 1, 0)

Level 1 - 应用函数

函数描述示例
CROSS(A, B)A 上穿 BCROSS(MA(5), MA(10))
CROSSDOWN(A, B)A 下穿 BCROSSDOWN(MA(5), MA(10))
COUNT(X, N)N 周期内满足条件的天数COUNT(CLOSE > OPEN, 10)
EVERY(X, N)N 周期内全部满足条件EVERY(CLOSE > MA(20), 5)
EXIST(X, N)N 周期内存在满足条件EXIST(CLOSE > HHV(HIGH, 60), 5)
BARSLAST(X)上次满足条件到现在的周期数BARSLAST(CROSS(MA(5), MA(10)))

Level 2 - 技术指标

函数描述返回字段
RSI(N)相对强弱指数rsi
MACD(S, L, M)MACD 指标dif, dea, macd
KDJ(N, M1, M2)KDJ 随机指标k, d, j
BOLL(N, P)布林带upper, mid, lower
WR(N)威廉指标wr
ATR(N)平均真实波幅atr
CCI(N)商品通道指数cci
BIAS(N)乖离率bias
PSY(N)心理线psy

Authorizations

Authorization
string
header
required

Enter your Bearer token

Response

Successful Response

name
string
required
type
string
required
level
integer
required
description
string
required