Ora
All documentation Overview

Get started

IntroductionQuickstartHow ora-fin1 decidesHow to build with OraUse-case map

Rule language

OverviewGrammarOperators and beliefsPrices and offsetsWindowsIndicatorsSignals and eventsPattern functionsFunction referenceRule libraryCommon mistakesError messagesEarnings and dividend facts

Questions & answers

Questionsyes_no (noul)choicescoreConfidenceThresholds and calibrationStateAsk by symbol

Patterns

Patterns

Actions & workflows

OverviewRules and templatesDestinationsWebhooks and signaturesWorkflows

API reference

POST /v1/systemoneGET /v1/models

Errors & limits

ErrorsRate limitsKnown limitations

Pricing

Pricing

Resources

FAQChangelogModels & versionsCode in 8 languages

Docs / Rule language

Rule language

Error messages

A rule that cannot be read or run is a 422, before anything is billed. detail lists every bad question, each pointing at its ask, so one response shows every problem.

Rule errors

One request with eleven broken rules on SPY returned one 422 listing all of them:

QuestionRuleMessage
typoC > smaa(C, 50)Unknown function 'smaa()'. Did you mean sma()?
pattern_typohamer()Unknown function 'hamer()'. Did you mean hammer()?
state_fieldrsi > 70No field "rsi" — this request has no named state, only price bars (O, H, L, C, V and the functions).
arityC > sma(C)sma() takes 2 argument(s), got 1.
zero_periodC > sma(C, 0)sma(): period must be greater than 0, got 0.
offset_on_functionsma(C, 20)[-1] > 0Unexpected token '[' at column 11
incompleteC >Unexpected token 'EOF' at column 3
unbalanced(C > OExpected ')', got 'EOF' at column 6
intradayC > vwap()vwap() needs intraday bars. Ask for them with "prices": {"interval": "5m"} (or 1m/15m/30m/1h).
timeframeC@5m > O@5m'@5m' needs 5m bars, which this request did not load. Ask for them with "prices": {"interval": "5m"}, or compare on 1d instead.
rec_without_selfrec(C, C) > 0rec(): the step must refer to `self`, otherwise nothing is recursive — use the expression on its own instead.

Parse errors also carry the column and a caret under the problem, after the first line:

Unexpected token 'EOF' at column 3
C >
  ^
Intraday names

The messages for vwap() and @5m mention a "prices" option. Ora does not offer it: rules run on daily bars only, so write the rule on daily data instead.

Request errors around rules

CaseResponse
A rule without a symbol
{
  "detail": [
    {
      "loc": [
        "body",
        "state",
        "symbol"
      ],
      "type": "missing",
      "msg": "Rules (`ask`) are evaluated on a symbol's price history: add \"state\": {\"symbol\": \"TSLA\"}."
    }
  ]
}
A symbol Ora does not cover
{
  "detail": [
    {
      "loc": [
        "body",
        "state",
        "symbol"
      ],
      "type": "value_error",
      "msg": "No market data for `ZZQXW`. Asking by symbol covers about 2,000 liquid US stocks and ETFs; for anything else send `state.context` yourself."
    }
  ]
}
An empty ask
{
  "detail": [
    {
      "loc": [
        "body",
        "questions",
        "above_50d",
        "ask"
      ],
      "type": "string_type",
      "msg": "`ask` must be a rule, e.g. \"C > sma(C, 50)\""
    }
  ]
}

When the rule engine is paused

During maintenance, requests that contain ask rules get a 503 with a Retry-After header; English questions and forecasts keep working. Retry after the number of seconds given.

Status codes for everything else: Errors.

Create an account Open the Playground Everything here also lives in the console, next to your keys and usage.