Strategy Reference

Astral strategies are structured, rule-based specifications generated and revised through chat. The code view is the inspectable representation used by backtesting and deployment workflows; review it before saving or operating a strategy.

Core structure

Assets and bar size

Define the market instruments and evaluation interval. Strategy and deployment support can vary by asset class and timeframe.

Derived series and indicators

Transform OHLCV or supported datasets into reusable numeric series such as moving averages, momentum, volatility, or custom formulas.

Signals and conditions

Boolean expressions determine when a rule is eligible to run. Crosses, comparisons, logical combinations, and supported event data can be represented.

Rules and orders

Rules connect a condition or schedule to one or more simulated or deployed actions, including sizing and optional risk instructions.

Price data and common functions

Strategies can reference open, high, low, close, and volume for configured assets. Common supported calculations include SMA, EMA, RSI, ATR, MACD components, Bollinger Bands, stochastic values, VWAP, rolling minimum/maximum/sum, lag, percent change, difference, z-score, logarithm, absolute value, clamping, conditional selection, and crossover helpers.

Function availability and signatures are validated by the current strategy schema. If generated code fails validation, ask Astral to correct it rather than manually guessing at an unsupported signature.

Actions, sizing, and risk

Backtests can model long and short actions where supported by the strategy engine. Position sizing can use a percentage of equity, fixed dollars, or fixed shares. Rules may include take-profit, stop-loss, or trailing-stop instructions.

Live broker support is narrower than backtest expressiveness. Current connected execution is documented as long-only and subject to broker, account, asset, timeframe, order, and rollout restrictions. A backtest accepting a rule does not mean every connected broker can execute it.

Specification fields

assetssymbol[]required

The instruments evaluated by the strategy. Confirm each symbol and asset class before running a backtest.

bar_sizeintervalrequired

The evaluation interval used for indicators and conditions. Historical coverage and connected deployment support vary by interval.

rulesrule[]required

The entry, exit, schedule, and risk conditions that produce simulated or deployed actions.

position_sizeequity | dollars | shares

The sizing instruction used when a rule creates an order. Review maximum exposure and broker compatibility separately.

Alternative and event data

Astral can use supported alternative datasets for research and strategy rules, including categories such as corporate filings and events, analyst data, market movers, macro data, financial data, and public-official transaction disclosures. Coverage, fields, timestamps, and historical depth vary by dataset.

Event availability must be interpreted at its publication time. Avoid writing or evaluating a backtest as if delayed or later-corrected data had been known earlier.

Validation checklist

  1. Confirm every asset and its intended asset class.
  2. Confirm the bar size and historical period.
  3. Read each entry and exit condition.
  4. Check how multiple conditions are combined.
  5. Review size, capital, and maximum exposure assumptions.
  6. Review stop, target, and trailing behavior.
  7. Check that live deployment restrictions are compatible before selecting a broker mode.