# AI Reference (.md)

A single token-optimized markdown file you can drop into ChatGPT, Claude, or any LLM. Pasting it as context lets the model write Quant Charts indicators and strategies without hallucinating signatures.

The bundle covers the full authoring surface: Python [`@indicator`](https://quantchartsllc.com/docs/python/py-decorators.md#indicator) and [`@strategy`](https://quantchartsllc.com/docs/python/py-decorators.md#strategy) decorators, all input types, the plotting / styling / shape-marker API, signal helpers, the `ta` namespace, custom canvas drawing, tags, triggers, the Rust [`#[indicator]`](https://quantchartsllc.com/docs/rust/rust-indicator.md#indicator) and [`#[strategy]`](https://quantchartsllc.com/docs/rust/rust-strategy.md#strategy) macros, the `BarStrategy` / `Strategy` traits, [`TickData`](https://quantchartsllc.com/docs/rust/rust-data.md#tickdata), [`DayPrep`](https://quantchartsllc.com/docs/rust/rust-data.md#dayprep), and [`SignalOutput`](https://quantchartsllc.com/docs/rust/rust-strategy.md#signaloutput)/[`IndicatorOutput`](https://quantchartsllc.com/docs/rust/rust-indicator.md#indicatoroutput) builders. It includes runnable end-to-end examples for both languages.

Download the .md file or copy from the preview below. Use a prompt like: "Use the attached Quant Charts API reference to write a Python indicator that plots a 14-period RSI with overbought (70) and oversold (30) bands."

The bundle is engineered for token efficiency: one-line signatures, no tables, one canonical example per concept. Fits comfortably inside a single prompt-cache block on Anthropic and OpenAI APIs.

### Notes

- Update cadence: regenerated whenever the public API changes. Re-download after a Quant Charts update if your LLM produces stale code.
- For deep dives on a specific feature, point the LLM at the Python or Rust tab in this Help; the bundle is intentionally compact.

<a id="what-is-included"></a>
## What is included

Section-by-section table of contents for the bundle, so you know what you are handing the model.

Python Indicator: decorator, class shape, all 7 input types, plot/hline/fill, 4 colored-plot wrappers, bar styling, plotshape, signal helpers (cross_above, between, rising, ...), ta namespace, custom_layer with viewport sentinels, define_tag, block_entries / breakeven_when / shift_levels trade modification, use_indicator composition, logging.

Python Strategy: decorator, return-dict shape, day_start hoisting rules, full EMA-cross example, microstructure conventions, global price series imports, column resolvers.

Rust Indicator: macro, Indicator trait, all 7 PlotTypes, IndicatorOutput builders.

Rust Strategy (TBBO): macro, Strategy trait, prepare/calculate split, full TickData column reference, SignalOutput builders, helper namespace, custom canvas.

Common Pitfalls: timestamp units, ET trading-day boundaries, fill conventions, optional TBBO column handling.

Compact runnable examples: RSI indicator, SMA-cross with SL/TP, mini imbalance Rust strategy.
