一键导入
create-indicator
Create a new open-xquant Indicator with tests and registry wiring; use after create-component confirms no existing indicator satisfies the request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a new open-xquant Indicator with tests and registry wiring; use after create-component confirms no existing indicator satisfies the request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when open-xquant artifacts must be checked for version/run/final traceability before comparison, report review, migration, or final selection.
Compile an open-xquant strategy spec preview and audit that material SPEC execution semantics are preserved in compiled_plan.json before backtests.
Audit strategy_idea_brief.json and the brainstorm conversation before strategy_spec.yaml construction begins.
Audit strategy_spec.yaml field provenance before backtests.
Author workspace-local OpenXQuant custom components from component_request.json, with tests, manifest hashing, catalog refresh, and no global SDK mutation.
Guide a user through the open-xquant pre-spec strategy idea workflow and produce strategy_idea_brief.json before any strategy_spec.yaml work begins.
| name | create-indicator |
| description | Create a new open-xquant Indicator with tests and registry wiring; use after create-component confirms no existing indicator satisfies the request. |
You create a pure numeric time-series component.
Default built-in paths:
src/oxq/indicators/{snake_name}.pytests/indicators/test_{snake_name}.pysrc/oxq/indicators/__init__.pysrc/oxq/core/registry.pyIf the user is building a third-party extension instead of a built-in, use
dynamic oxq.register_indicator() in that package and state that it is not
persistently built into open-xquant.
Read before editing:
src/oxq/core/types.pysrc/oxq/indicators/sma.pytests/indicators/src/oxq/indicators/__init__.pysrc/oxq/core/registry.pyConfirm:
name equals the registry namecompute() returns pd.SeriesState the design before coding:
Ask the user if the formula or defaults are ambiguous.
Write tests with hand-calculated expectations. Include:
Indicatorpd.Series with same indexname valueRun the new test and confirm it fails for the missing implementation before writing source when this is a new built-in.
uv run pytest tests/indicators/test_{snake_name}.py -v
Use pandas, numpy, and stdlib by default. For optional third-party dependency:
pyproject.tomlImplementation skeleton:
"""Short description indicator."""
from __future__ import annotations
import pandas as pd
class ClassName:
"""Short behavior description."""
name = "ClassName"
def compute(
self,
mktdata: pd.DataFrame,
column: str = "close",
period: int = 20,
) -> pd.Series:
"""Return the indicator series."""
...
Composite indicators should compute dependencies internally unless the existing engine dependency pattern is explicitly being used.
For a built-in component:
src/oxq/indicators/__init__.py__all___load_builtins() in src/oxq/core/registry.pyVerify:
uv run python - <<'PY'
import oxq
assert "ClassName" in oxq.list_indicators()
print("registered")
PY
uv run pytest tests/indicators/test_{snake_name}.py -v
Run broader tests when registry or shared behavior changes.