# What This System Can Do

TBBO + OHLC backtester with Python (OHLC bars) and Rust (TBBO ticks) strategy/indicator APIs, an analyzer with parameter sweeps, and an in-app AI panel for editing files.

Quant Charts is a desktop trading research environment. It loads parquet files (OHLC bars or TBBO tick-by-tick), renders them through TradingView Lightweight Charts, and runs strategies/indicators against them. Strategies in Python execute on aggregated OHLC bars; strategies in Rust execute on raw TBBO ticks for tick-precise microstructure logic. Backtests run through a vectorized Rust engine that returns trades, equity curves, and stats. The analyzer sweeps parameter grids in parallel, persists results, and renders 2D and 3D scatter widgets for combo selection.

### Notes

- Workspace lives at `your workspace/` with `strategies/`, `indicators/`, `notebooks/`, `whiteboards/`, `exports/`.
- Templates are seeded into empty folders on first launch and refreshed via baseline migration.
- Authentication and licensing are LemonSqueezy-backed; subscriptions sync from LemonSqueezy into Supabase.

<a id="feature-checklist"></a>
## Feature checklist

High-level capability list. Each row links to deeper sections in the Features group.

Charting:
- TradingView Lightweight Charts v5 with custom canvas primitives (TradeBracketPrimitive, IndicatorOverlayPrimitive)
- TBBO tick-mode rendering plus OHLC bar mode (any timeframe via WASM aggregator)
- Volume pane (histogram subpane below price), bar coloring, plotshape markers, bgcolor / box regions

Backtesting:
- Vectorized Rust engine with SL/TP brackets (entry-only or per-tick re-evaluation)
- Long + short signals, conflict resolution, fill conventions (long entry = ask, exit = bid; short reversed)
- Per-trade MAE / MFE / SNR tracking

Analyzer:
- Strategy mode: single-day backtest, multi-day backtest, parameter sweep (cartesian or fixed-N), 2D + 3D scatter widgets, top-N tables
- Indicator mode: per-indicator horizon analysis (forward returns, hit rates, MAE/MFE distributions)
- Preventive tag filtering through trading_mask (Rust-only re-run, no Python re-execution)
- Per-instance Strategy TF override pill in chart top bar

MCP server:
- Local MCP server exposes workspace files to Claude Desktop / other clients
- Tools: list, read, write, edit, validate, run_backtest, find_workspace_file (fuzzy lookup)
- Subscription-guarded, IPC-isolated

In-app AI panel:
- Four mode quadrants: (strategy | indicator) x (TBBO Rust | OHLC Python)
- Mode-specific system prompts and starter prompts
- File-aware editing of the active strategy or indicator

Notebooks + scripts:
- Jupyter integration for inline backtests (`qc.run`, `qc.optimize`, `qc.wfa`) and saved-run analysis (`qc.load_run`)
- @script .py files with `script_helpers` (export_csv, export_parquet, export_json)

Keyboard:

<a id="where-to-start"></a>
## Where to start

Pick a path: chart a file, write a strategy, or sweep a grid.

New users:
1. Drag a parquet file into the chart, or open one from File > Open Data.
2. Open the Templates section in this tab to find a baseline strategy / indicator that matches your goal.
3. In the Files panel, double-click a `.py` or `.rs` template to open it. The Monaco editor and AI panel both pick up the file.
4. Click Run in the strategy/indicator panel to attach it to the chart, or open the Analyzer tab to sweep parameters.

For TBBO research:
1. Load `TBBO_Converted.parquet`.
2. Open [`vp.rs`](https://quantchartsllc.com/docs/templates/templates.md#vp-rs) for a tick-fidelity Volume Profile, or [`orderflow.rs`](https://quantchartsllc.com/docs/templates/templates.md#orderflow-rs) for imbalance + CVD-direction tags.
