# Rule cards and Programs

> The two kinds of strategy Claude can write in your project: rule cards built from Orbital's strategy nodes, and Programs, Rust code Orbital compiles for logic the cards cannot express.

Source: https://orbitalaip.com/docs/claude-and-chatgpt/rule-cards-and-programs

> [!IMPORTANT] Disclaimer
> Backtest results are hypothetical and do not predict future performance. Nothing here is investment advice: Orbital computes the rules you supplied and recommends nothing. Orbital is not a registered investment adviser or broker-dealer. Costs are as modelled by the chosen cost profile and may differ from live trading.

## Two kinds of strategy

Claude can write a strategy in two forms. A Rules strategy is a small graph of Orbital's [rule cards](https://orbitalaip.com/docs/glossary#rule-cards): a universe, indicators, rules, sizing and an output. A Program strategy replaces the rules with a Rust function that Orbital compiles and calls on every bar. Both use the same tools, which [The eleven tools](https://orbitalaip.com/docs/claude-and-chatgpt/tools) lists.

## Rule cards

Claude sends a strategy as nodes and the connections between them. Each node has an id, a type and a config. The authoring guide, `get_authoring_guide` with topic `rule_card`, gives Claude the recipe, every node's schema and one valid example. Each node type is one node in Orbital; see [every node's fields](https://orbitalaip.com/docs/backtesting/rule-card-strategies).

| Node type | Node in Orbital |
| --- | --- |
| universe-input | Input, with its Source set to Universe |
| indicator | Indicator |
| entry-rule | Entry Rule |
| exit-rules | Exit Rules |
| sizing | Position Sizing |
| session-filter | Session Filter |
| regime-filter | Regime Filter |
| risk-guard | Risk Guard |
| program | Program |
| output | Output |

Indicators are wired into the rules that read them. The rules chain in a fixed order: **Entry Rule**, **Exit Rules**, **Position Sizing**, **Output**. The **Input** node and the three optional nodes need no wiring; Orbital finds them by type.

The guide's example is the same SPY golden cross that [Your first strategy](https://orbitalaip.com/docs/getting-started/your-first-strategy#set-each-node) builds by hand.

A Rules strategy can declare parameters, which Claude sends as `declared_parameters` when it saves and sets by name in `run_backtest`; see [Parameters a run can vary](https://orbitalaip.com/docs/backtesting/rule-card-strategies#parameters-a-run-can-vary).

## Programs

A Program is a Rust function that Orbital compiles and calls once per symbol on every bar of the decision bar you pick, in place of the **Entry Rule** and **Exit Rules** nodes; the universe and the sizing keep their own nodes. Write one when the rule needs memory across bars, the session clock, a conviction score to rank on, or a stop the rule cards have no node for; see [What a Program is](https://orbitalaip.com/docs/backtesting/program-strategies#what-a-program-is).

The **Program** node's **Decision bar**, **History the program reads (bars of the decision bar)**, **Parameters** and **Module reference** are `decision_timeframe`, `warmup_bars`, `parameters` and `module_ref`; see [the Program node's fields](https://orbitalaip.com/docs/backtesting/program-strategies#the-program-card).

Claude reads the manual (`get_authoring_guide` with topic `program`), saves with `create_strategy` and `allow_incomplete_config` set to true, builds with [build_program](https://orbitalaip.com/docs/claude-and-chatgpt/tools/build_program), then estimates and runs; see [A Program from Claude or an agent](https://orbitalaip.com/docs/backtesting/program-strategies#a-program-from-claude-or-an-agent).

A run refuses a Program whose source changed since its last build. A Program has no declared parameters: to try other values, Claude saves the graph again with the node's **Parameters** changed, and the build still stands.

## Versions

Every save and every build writes a new version hash, and Orbital refuses a save built on a version Claude has not read, such as your own edit in the editor, so nothing is overwritten. The numbered versions Orbital shows, v1, v2 and the one marked **Main**, are recorded only when a run is launched or when you save a version in the editor; see [Versions](https://orbitalaip.com/docs/workflows/runs-and-versions#versions).

## Where to find it in Orbital

Open **Backtesting**: the **Strategies** list holds every strategy in the project, including those Claude created. On a strategy's page, **Workflow ↗** opens a Rules strategy's graph, and **Code ↗** opens a Program in the Program editor, where **Build** and **Test** live.
