# Alice Analysis

Optional technical-analysis formulas and snapshots through alice analysis.

- Repository: https://github.com/TraderAlice/OpenAlice (7404 stars)
- Category: Engineering
- License: AGPL-3.0
- Last updated: 2026-10-24
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add TraderAlice/OpenAlice --skill alice-analysis -g -a claude-code -y`
Codex: `npx skills add TraderAlice/OpenAlice --skill alice-analysis -g -a codex -y`
Cursor: `npx skills add TraderAlice/OpenAlice --skill alice-analysis -g -a cursor -y`
Gemini CLI: `npx skills add TraderAlice/OpenAlice --skill alice-analysis -g -a gemini-cli -y`

## Description

Optional technical-analysis formulas and snapshots through alice analysis. Documents the bounded expression language, barId source selection and panels. Raw K-lines for local scripts are available through alice market bars.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# `alice analysis`, Quant Calculator (v2)

A bounded, side-effect-free expression language for technical analysis. You write
a short script; it fetches K-lines by **barId** and returns a value (or a panel
of values). Get barIds from `alice analysis search-bars` first.

## Example

```bash
alice market search-bars --query AAPL
alice analysis quant --script $'s = bars("alpaca-paper|AAPL", "1d", count=250)\nsma(s.close, 50)'
```

## Choosing a source

`search-bars` federates broker and vendor bars. Choose a source by the asset,
coverage and entitlement needed for the task. A broker feed is not necessarily
realtime or complete; metadata reports its advertised capability. Different
sources for the same asset remain separate barIds.

For custom processing, `alice market bars ... --output bars.json` returns raw
OHLCV and metadata for local scripts. The calculator is an optional shortcut.

Vendor barIds infer the asset class from an exact catalog match. If lookup is
unavailable or ambiguous, the calculator accepts an explicit `asset=` hint.
Keyless exchange data sources such as `binance-readonly` are opt-in in
Trading settings, so do not assume they exist before `search-bars` returns them.

**No candidates for a non-US symbol?** `search-bars` only fans out over the
vendors that are *on*. A Taiwan or CN A-share searched by its native name can
come back empty just because its vendor is off, `alice market vendors` to see
what's available, `alice market vendor-set --vendor twse --enabled true` to add
it (live immediately), then re-run search-bars. See the `alice` skill.

## Language

A script is zero or more `name = ...` bindings, then a final result expression:

```python
s = bars("alpaca-paper|AAPL", "1d", count=250)
sma(s.close, 50) - sma(s.close, 200)        # +ve = 50 above 200 (uptrend)
```

The rest: https://github.com/TraderAlice/OpenAlice/blob/HEAD/default/skills/alice-analysis/SKILL.md
