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

Rule language

A rule is a precise statement about a stock's own price history, such as C > H[-1] (closed above yesterday's high) or C > sma(C, 200) and rsi(C, 14) < 40. Ora evaluates it exactly on the latest completed session and answers with a belief: how decisively it is true.

In short
  • Send a rule as a yes_no question with "ask" instead of "instructions", on a {"symbol": …} state.
  • The answer is a belief from 0.05 to 0.95: 0.50 exactly on the line, further from 0.50 the further past it, measured on that symbol's own normal scale.
  • English questions about what is true now are compiled into the same language, and the answer shows the rule it ran.
  • Rules and forecast questions mix freely in one request, and actions can fire on both.

Why a rule language

A forecast is a model's estimate of what happens next. Many trading decisions also need a fact about now: is it above the 200-day, did it gap, is this an inside day, is volume heavy. A model should not guess those; they can be computed. Ora computes them, in the same request as the forecasts, with no data to send.

ExactThe rule runs on the symbol's daily bars (adjusted for splits) with the indicator definitions on these pages. Nothing is sampled or estimated.
GradedA belief says how far past the line the reading is, so rsi(C, 14) > 70 with RSI at 71 and at 85 are different answers. A boolean cannot say that.
One grammarEntries, exits, filters, scans, pattern checks and alert conditions are all written the same way, with and, or and not.
ExplainableEvery rule answer carries the rule it evaluated, so a log of decisions is also a log of exactly what was checked.
Safe to typeA misspelled function is a 422 that names the nearest real one (Did you mean sma()?), never a rule that silently cannot fire.

Send a rule

{
  "model": "ora-fin1",
  "state": {
    "symbol": "NVDA"
  },
  "questions": {
    "above_50d": {
      "type": "yes_no",
      "ask": "C > sma(C,50)"
    }
  }
}
Open this in the Playground

The real answer for the session of 2026-10-30:

{
  "model": "ora-fin1",
  "answers": {
    "above_50d": {
      "type": "yes_no",
      "yes_no": 0.0746,
      "rule": "C > sma(C,50)",
      "basis": "rule"
    }
  },
  "usage": {
    "input_tokens": 291,
    "output_tokens": 4
  },
  "context": {
    "source": "server",
    "symbol": "NVDA",
    "as_of": "2026-10-30"
  },
  "version": "ora-fin-0.1.1"
}

What a rule answer contains

Field
yes_noThe belief, 0.05 to 0.95. See Operators and beliefs.
ruleThe rule that was evaluated: yours, or the one an English question was compiled to.
basisrule when you sent ask; comparison or pattern when an English question was compiled.
explainCompiled comparisons only: a short reading of the rule, such as today's close > sma200.

An answer with no rule came from the forecast model. From English to rule shows which questions compile and which do not.

A tour in six rules

IdeaRuleWhere
Closed above yesterday's highC > H[-1]Prices and offsets
20-day closing breakoutC > highest(C, 20)Windows
Trend plus momentumC > sma(C, 200) and rsi(C, 14) > 50Operators and beliefs
Crossed above the 50-day todaycrossup(C, sma(C, 50))Signals and events
Hammer at a 20-day lowhammer() and L <= 1.01 * lowest(L, 20)Pattern functions
Volume twice the prior averageV > 2 * ref(avg(V, 20), -1)Rule library

In this section

What rules cannot do (yet)

  • Rules run on daily bars only: no intraday bars, no @5m timeframes, no vwap() or opening range.
  • A rule reads one symbol's history. To compare a stock with an index, ask both and compare the answers in your code.
  • Rules cannot read numbers you send in state.context; they need a covered symbol. Earnings, dividends and splits facts are planned.

Rules in ask are question rules. The conditions that decide whether an action fires (drop5 >= 0.6) are a separate, simpler syntax: Rules and templates.

Information, not investment advice. Beliefs and probabilities on this page are real responses for the session shown and change with every session.

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