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

Common mistakes

The rules that look right and are not, with what they really answered and what to write instead. Every number is a real answer.

#MistakeInstead
1Using max() for a breakoutUse highest/lowest for breakouts and max/min for "where it stands now".
2Expecting a tie to count as trueGive the line some room: C >= 0.98 * max(H, 20), or use the excluding form.
3Putting an offset on a functionref(sma(C, 20), -1).
4Looking forward by accidentOffsets that look back are negative: C[-1].
5A window longer than the historyKeep windows under about 1,000 sessions; a year is 252.
6Comparing today with an average that includes todayV > 2 * ref(avg(V, 20), -1) compares with the 20 sessions before today.
7Mixing and with or without parenthesesAlways bracket a mix of and and or.
8Mixing unitsCheck the unit on the function's entry in the reference.
9Writing a state fieldrsi(C, 14) > 70.
10Trusting that an English question became a ruleCheck for rule in the answer, or write it: H > highest(H, 252).
11Reading an event as a stateUse C > sma(C, 50) for the state, or barssince(crossup(…)) <= 5 for "recently".
12Reading a belief as a probabilityUse rule beliefs as filters and strength, forecasts as odds: Reading beliefs.

1. Using max() for a breakout

C > max(C, 20) can never be true, because the window includes today. On XLE, which closed at a 20-session high, it is 0.5 while C > highest(C, 20) is 0.6462.

Instead: Use highest/lowest for breakouts and max/min for "where it stands now".

2. Expecting a tie to count as true

>= and <= answer 0.50 on an exact tie, not a high belief. C >= max(C, 20) can at best tie, because the window contains today: on XLE, at its 20-day high, it is 0.5, and on SPY C >= max(C, 1) (today against itself) is 0.5.

Instead: Give the line some room: C >= 0.98 * max(H, 20), or use the excluding form.

3. Putting an offset on a function

sma(C, 20)[-1] is not valid: Unexpected token '[' at column 11

Instead: ref(sma(C, 20), -1).

4. Looking forward by accident

C[1] is the next bar, which does not exist: C > C[1] on XLE is 0.5.

Instead: Offsets that look back are negative: C[-1].

5. A window longer than the history

About 1,500 sessions are loaded; C > sma(C, 2000) is 0.5 ("not known") on XLE.

Instead: Keep windows under about 1,000 sessions; a year is 252.

6. Comparing today with an average that includes today

On a spike day, today's volume is part of avg(V, 20), which dampens the comparison.

Instead: V > 2 * ref(avg(V, 20), -1) compares with the 20 sessions before today.

7. Mixing and with or without parentheses

and binds tighter. On AAPL, a or b and c is 0.9119 and (a or b) and c is 0.7437.

Instead: Always bracket a mix of and and or.

8. Mixing units

Returns written by hand are fractions (C / C[-1] - 1 > 0.02 is 2%), but roc() and atr_pct() are percents (roc(C, 20) > 5 is 5%).

Instead: Check the unit on the function's entry in the reference.

9. Writing a state field

rsi > 70 reads rsi as a field, and rules on Ora have none: No field "rsi" — this request has no named state, only price bars (O, H, L, C, V and the functions).

Instead: rsi(C, 14) > 70.

10. Trusting that an English question became a rule

"Is it at a 52-week high?" was answered by the forecast model on TSLA (0.533, no rule in the answer), because the compiler did not recognise it as a "now" question.

Instead: Check for rule in the answer, or write it: H > highest(H, 252).

11. Reading an event as a state

crossup(C, sma(C, 50)) is 0.95 only on the day of the cross and 0.05 on every day after, even while price stays above.

Instead: Use C > sma(C, 50) for the state, or barssince(crossup(…)) <= 5 for "recently".

12. Reading a belief as a probability

A rule's 0.70 does not mean a 70% chance of anything; the condition already holds or not. It says how clearly.

Instead: Use rule beliefs as filters and strength, forecasts as odds: Reading beliefs.

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.