longbridge-quant

Runs quantitative strategy frameworks and indicator scripts against Longbridge K-line data.

Updated Aug 15, 2026
One-click install
npx skills add https://github.com/qqlcx5/skills-hub --skill longbridge-quant-qqlcx5
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: longbridge-quant
Source: https://github.com/qqlcx5/skills-hub/tree/main/skills/longbridge-quant
Command: npx skills add https://github.com/qqlcx5/skills-hub --skill longbridge-quant-qqlcx5

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scikit-learn, pandas, numpy, statsmodels, scipy, arch, and includes references (resource) components.

What problem does it solve? Quantitative analysis requires combining statistical tests, factor research, and backtesting workflows that are tedious to set up manually. This Skill provides ready-made frameworks for pairs trading, volatility regimes, seasonality, multi-factor models, and ML prediction, all powered by Longbridge market data. ## Core Features & Use Cases - Strategy Frameworks: Covers pairs trading/cointegration, volatility regime strategies, seasonality effects, multi-factor stock selection, factor research (IC/IR), hedging, and execution cost modeling. - Quant CLI: Runs user-defined Navi or PineScript indicator scripts server-side against historical K-line data via longbridge quant run. - Statistical & ML Tooling: Includes ADF/GARCH statistical tests, walk-forward optimization, and sklearn-based Random Forest prediction with backtest metrics. - Use Case: Ask whether two stocks are cointegrated and receive the hedge ratio, spread Z-score, half-life, and a trade signal computed from 252 days of Longbridge K-line data. ## Quick Start Ask the assistant to test whether AAPL.US and MSFT.US are cointegrated and suitable for a pairs trading strategy.

Frequently Asked Questions about longbridge-quant

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test if two stocks are cointegrated for pairs trading?

Fetch 252 daily candles for each symbol with `longbridge kline`, then run an Engle-Granger test: regress log prices via OLS to get the hedge ratio and apply an ADF test on the residuals. A p-value below 0.05 indicates cointegration, and the spread Z-score drives entry and exit signals.

How to run a custom indicator script on stock K-line data?

Use `longbridge quant run <SYMBOL> --start <date> --end <date> --script "..."` to execute a Navi script server-side against historical K-line data. Add `--language pine` for PineScript compatibility and `--format json` for machine-readable output.

What factors does the multi-factor stock selection model use?

The model scores stocks on value (1/PE, 1/PB), 60-day momentum, quality (ROE), and low volatility (60-day HV). Each factor is standardized to Z-scores across the universe and combined into an equal-weighted or IC-weighted composite to rank top and bottom stocks.

Does the quant CLI require a Longbridge login?

No, the `quant` CLI is public and requires no login, and all analytical frameworks are read-only. However, commands like `longbridge positions` for hedging analysis require `longbridge auth login` with Trade scope.

Why does the ADF test fail with insufficient data?

The ADF unit-root test needs at least 50 observations to produce reliable results. Increase the K-line history by requesting more candles, such as `--count 252`, before running stationarity or cointegration tests.

What Python packages are needed for the ML prediction strategy?

The walk-forward ML framework requires scikit-learn, pandas, and numpy, with optional xgboost or lightgbm for gradient boosting. If scikit-learn is unavailable, the workflow degrades to a simpler logistic regression model.