docs: Update quant scripting docs for Navi#1169
Merged
Merged
Conversation
`longbridge quant run` now defaults to Navi, so the CLI docs and the longbridge skill were rewritten around it. Every example script is new Navi source that passes `navi lint`. Also corrects errors the rewrite surfaced: - `jq` paths used `.data.report_json`, which no longer resolves; the report is at `.report_json`. - The Bollinger example said `ta.bbands` was unavailable and built the bands from `ta.sma` + `ta.stdev`; Navi's `ta.bb` returns basis, upper, and lower directly. - Indicator outputs were stale — they are now real `quant run` output. - `strategy()` settings referenced `strategy.commission.percent` and `strategy.fixed`; these are `CommissionType` and `DefaultQtyType` variants in Navi. Syntax highlighting switches to the official Navi TextMate grammar from navi-docs, registered as `navi` with an `nv` alias. The `pine` alias is dropped along with the OpenPine grammar, and all fences now use `nv`. Per-language reference detail is kept deliberately thin — navi-lang.org is authoritative and its API evolves. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
huacnlee
added a commit
to longbridge/skills
that referenced
this pull request
Jul 20, 2026
`longbridge quant run` now defaults to Navi ([longbridge-terminal#267](longbridge/longbridge-terminal#267)). ## Changes to `skills/longbridge-quant/references/quant-cli.md` - **Refreshed the `--help` dump** — it gained `--language` (`navi` default, `pine` for PineScript compatibility) - **Added a Navi example script**, verified with `navi lint`. The reference had no example script at all before - **Notes** now point at [navi-lang.org](https://navi-lang.org) as authoritative and mention `navi lint`, since the API reports script errors only as an opaque error code - **Documented a JSON-mode caveat**: `--format json` sets `exclude_chart`, so series values are absent from the response — screening has to read the `Last` column from the table output instead Related: [longbridge/developers#1169](longbridge/developers#1169) covers the public docs and the `longbridge` skill. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
longbridge quant runnow defaults to Navi (longbridge-terminal#267), so the CLI docs and thelongbridgeskill are rewritten around it.Scope
docs/{en,zh-CN,zh-HK}/docs/cli/quant/index.md— language section and all examplesdocs/{en,zh-CN,zh-HK}/docs/cli/quant/backtest.md— 4 strategy scripts and thestrategy()settings tableskills/longbridge/references/cli/quant.md— 11 examplesEvery example script is new Navi source and passes
navi lint.Errors this surfaced
These were already broken before the rewrite:
jqpaths were wrong. Docs used.data.report_json; the report is at.report_json. Every documented backtest one-liner returnednull.ta.bbandswas unavailable and built bands fromta.sma+ta.stdev. Navi'sta.bbreturns(basis, upper, lower)directly.strategy()settings named PineScript symbols —strategy.commission.percent,strategy.fixed,strategy.percent_of_equity— which in Navi areCommissionType/DefaultQtyTypevariants.quant runoutput.Syntax highlighting
Replaces the OpenPine TextMate grammar with the official Navi grammar from
navi-docs, registered asnaviwith annvalias. Thepinealias is dropped, and all fences usenv.Note on remaining stale values
The JSON figures under Backtesting in
backtest.mdare carried over unverified — the quant API has been returningcode=14(UNAVAILABLE) and I could not re-run them. Worth re-checking once it recovers. The indicator tables inindex.mdare freshly captured.Per-language reference detail is kept deliberately thin: navi-lang.org is authoritative and its API evolves.
🤖 Generated with Claude Code