Ora
All guides All guides

Getting started

Your first decision in the Playground Call the API from your code Save, share and reuse queries

Financial decisions

Decide on a stock with just its symbol Write your own rule Read probabilities and choose thresholds

Rule playground

From English to rule Combining conditions Offsets and windows Reading beliefs Rules plus forecasts in one request Turning a rule into an alert or workflow

Automation

Send a Slack alert when a rule fires Send decisions to your own system Run a watchlist every day after the close

Production

Handle errors, rate limits and retries

Cookbooks

All cookbooks Rank a watchlist by probability Send a pre-open digest Trend filter plus entry trigger Breakout confirmation with volume RSI and Bollinger mean-reversion checks Gap-fill playbook to your order system Confidence-gated actions Detect two-way risk Size positions by volatility regime Risk guardrail before an order Ask many questions in one request Self-consistency: three wordings Route support tickets Is a headline relevant to a symbol?

Use cases

Tag financial news for trading signalsGuardrails for LLM appsSupport ticket triage and routingFilter retrieved passages before your LLM answersVerify claims and citations against a source

Guides / Cookbooks

Cookbooks · Risk and execution · Intermediate · about 8 min

Size positions by volatility regime

Use ATR and realized-volatility rules to place each symbol in a calm, normal or high regime, and scale position size to match.

  1. When to use it

    The same dollar size is a very different risk in an index ETF and in a high-beta chip stock. Rules that measure the current regime give a size multiplier before any forecast is involved.

  2. The request

    atr_pct(14) is the 14-day average true range as a percentage of the close. hv_high is asked in English; the engine compiles it to a realized-volatility rule.

    {
      "model": "ora-fin1",
      "state": {
        "symbol": "NVDA"
      },
      "questions": {
        "atr_high": {
          "type": "yes_no",
          "ask": "atr_pct(14) > 3"
        },
        "atr_mid": {
          "type": "yes_no",
          "ask": "atr_pct(14) > 1.5"
        },
        "hv_high": {
          "type": "yes_no",
          "instructions": "Is its 20-day historical volatility above 40%?"
        },
        "drop5": {
          "type": "yes_no",
          "instructions": "Will it drop at least 5% at some point in the next month?"
        }
      }
    }
    Open this in the Playground
  3. The real response

    NVDA:

    {
      "model": "ora-fin1",
      "answers": {
        "atr_high": {
          "type": "yes_no",
          "yes_no": 0.5548,
          "rule": "atr_pct(14) > 3",
          "basis": "rule"
        },
        "atr_mid": {
          "type": "yes_no",
          "yes_no": 0.9463,
          "rule": "atr_pct(14) > 1.5",
          "basis": "rule"
        },
        "hv_high": {
          "type": "yes_no",
          "yes_no": 0.1582,
          "rule": "std(log(C / C[-1]), 20) * sqrt(20 / 19) * sqrt(252) > 0.4",
          "basis": "pattern"
        },
        "drop5": {
          "type": "yes_no",
          "yes_no": 0.523
        }
      },
      "usage": {
        "input_tokens": 395,
        "output_tokens": 16
      },
      "context": {
        "source": "server",
        "symbol": "NVDA",
        "as_of": "2026-10-30"
      },
      "version": "ora-fin-0.1.1"
    }

    The English question became std(log(C / C[-1]), 20) * sqrt(20 / 19) * sqrt(252) > 0.4 (annualized 20-day volatility over 40%). Across three symbols:

    Symbolatr_pct(14) > 1.5atr_pct(14) > 320-day HV > 40%Multiplier
    SPY0.05370.05370.05371×
    NVDA0.94630.55480.15820.75×
    AMD0.94630.94410.9380.5×

    NVDA's atr_high of 0.5548 is just past the 3% line: ATR is a touch above 3%, not far above it. A belief that close to 0.5 is the engine saying "borderline".

  4. The code

    Requires curl 7.76+. Save as run.sh, then: bash run.sh
    curl -sS https://oramodel.com/v1/systemone \
      -H "Authorization: Bearer $JEV_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "ora-fin1",
      "state": {
        "symbol": "NVDA"
      },
      "questions": {
        "atr_high": {
          "type": "yes_no",
          "ask": "atr_pct(14) > 3"
        },
        "atr_mid": {
          "type": "yes_no",
          "ask": "atr_pct(14) > 1.5"
        },
        "hv_high": {
          "type": "yes_no",
          "instructions": "Is its 20-day historical volatility above 40%?"
        },
        "drop5": {
          "type": "yes_no",
          "instructions": "Will it drop at least 5% at some point in the next month?"
        }
      }
    }'

    The multiplier in the table comes from this function:

    def size_multiplier(a):
        if a["atr_high"] >= 0.6 or a["hv_high"] >= 0.6:
            return 0.5      # high regime
        if a["atr_mid"] >= 0.6:
            return 0.75     # normal to busy
        return 1.0          # calm
    
    a = {k: v["yes_no"] for k, v in data["answers"].items()}
    shares = int(base_shares * size_multiplier(a))
  5. Act on it

    Apply the multiplier before the order is built, and log the regime with the trade. Re-check after each close: regimes change faster than most position-sizing tables are updated.

  6. Variations

    • Volatility targeting: size so that shares × ATR is a fixed dollar amount (read ATR from your own data and use the rule only as the regime label).
    • Use the beliefs smoothly instead of steps: multiplier = 1 − 0.5 × atr_high.
    • Add drop5 to cut size further when the drawdown odds are high (Risk guardrail before an order).

Information, not investment advice. Every number on this page is a real response for the session shown; answers change with each session.

What's next

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