Documentation
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
Derived series and indicators
Signals and conditions
Rules and orders
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[]requiredThe instruments evaluated by the strategy. Confirm each symbol and asset class before running a backtest.
bar_sizeintervalrequiredThe evaluation interval used for indicators and conditions. Historical coverage and connected deployment support vary by interval.
rulesrule[]requiredThe entry, exit, schedule, and risk conditions that produce simulated or deployed actions.
position_sizeequity | dollars | sharesThe 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
- Confirm every asset and its intended asset class.
- Confirm the bar size and historical period.
- Read each entry and exit condition.
- Check how multiple conditions are combined.
- Review size, capital, and maximum exposure assumptions.
- Review stop, target, and trailing behavior.
- Check that live deployment restrictions are compatible before selecting a broker mode.