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 · Advanced · about 12 min

Risk guardrail before an order

Before an order goes out, ask for its drawdown odds and trend, and send block, reduce or allow to your order system.

You'll need
  • A webhook connection named my-oms, or call the API inline from your order path.
  1. When to use it

    A last check before execution: no new long when a large drawdown is likely and the stock is already under its 50-day average; a half-size order when only the drawdown odds are high; otherwise allow. The three actions are exclusive, so exactly one decision arrives.

  2. The request

    {
      "model": "ora-fin1",
      "state": {
        "symbol": "TSLA"
      },
      "questions": {
        "drop5": {
          "type": "yes_no",
          "instructions": "Will it drop at least 5% at some point in the next month?"
        },
        "down_week": {
          "type": "yes_no",
          "instructions": "Will the stock be lower in a week?"
        },
        "below_50d": {
          "type": "yes_no",
          "ask": "C < sma(C,50)"
        }
      },
      "actions": [
        {
          "id": "block",
          "when": "drop5 >= 0.6 and below_50d >= 0.6",
          "do": "webhook",
          "connection": "my-oms",
          "body": {
            "symbol": "{{symbol}}",
            "decision": "block",
            "reason": "drawdown_risk_in_downtrend",
            "p_drop5": "{{drop5}}",
            "p_below_50d": "{{below_50d}}",
            "as_of": "{{as_of}}"
          }
        },
        {
          "id": "reduce",
          "when": "drop5 >= 0.6 and below_50d < 0.6",
          "do": "webhook",
          "connection": "my-oms",
          "body": {
            "symbol": "{{symbol}}",
            "decision": "reduce_size",
            "max_fraction": 0.5,
            "p_drop5": "{{drop5}}",
            "as_of": "{{as_of}}"
          }
        },
        {
          "id": "allow",
          "when": "else",
          "do": "webhook",
          "connection": "my-oms",
          "body": {
            "symbol": "{{symbol}}",
            "decision": "allow",
            "p_drop5": "{{drop5}}",
            "as_of": "{{as_of}}"
          }
        }
      ],
      "dry_run": true
    }
    Open this in the Playground
  3. The real response

    {
      "model": "ora-fin1",
      "answers": {
        "drop5": {
          "type": "yes_no",
          "yes_no": 0.638
        },
        "down_week": {
          "type": "yes_no",
          "yes_no": 0.455
        },
        "below_50d": {
          "type": "yes_no",
          "yes_no": 0.1039,
          "rule": "C < sma(C,50)",
          "basis": "rule"
        }
      },
      "usage": {
        "input_tokens": 358,
        "output_tokens": 12
      },
      "context": {
        "source": "server",
        "symbol": "TSLA",
        "as_of": "2026-10-30"
      },
      "version": "ora-fin-0.1.1",
      "actions": [
        {
          "id": "block",
          "fired": false,
          "status": "skipped"
        },
        {
          "id": "reduce",
          "fired": true,
          "status": "dry_run",
          "do": "webhook",
          "connection": "my-oms",
          "preview": {
            "body": {
              "symbol": "TSLA",
              "decision": "reduce_size",
              "max_fraction": 0.5,
              "p_drop5": 0.638,
              "as_of": "2026-10-30"
            }
          }
        },
        {
          "id": "allow",
          "fired": false,
          "status": "skipped"
        }
      ]
    }

    drop5 is 0.638 but TSLA is not under its 50-day average (below_50d 0.1039), so block was skipped and reduce fired with max_fraction: 0.5.

  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": "TSLA"
      },
      "questions": {
        "drop5": {
          "type": "yes_no",
          "instructions": "Will it drop at least 5% at some point in the next month?"
        },
        "down_week": {
          "type": "yes_no",
          "instructions": "Will the stock be lower in a week?"
        },
        "below_50d": {
          "type": "yes_no",
          "ask": "C < sma(C,50)"
        }
      },
      "actions": [
        {
          "id": "block",
          "when": "drop5 >= 0.6 and below_50d >= 0.6",
          "do": "webhook",
          "connection": "my-oms",
          "body": {
            "symbol": "{{symbol}}",
            "decision": "block",
            "reason": "drawdown_risk_in_downtrend",
            "p_drop5": "{{drop5}}",
            "p_below_50d": "{{below_50d}}",
            "as_of": "{{as_of}}"
          }
        },
        {
          "id": "reduce",
          "when": "drop5 >= 0.6 and below_50d < 0.6",
          "do": "webhook",
          "connection": "my-oms",
          "body": {
            "symbol": "{{symbol}}",
            "decision": "reduce_size",
            "max_fraction": 0.5,
            "p_drop5": "{{drop5}}",
            "as_of": "{{as_of}}"
          }
        },
        {
          "id": "allow",
          "when": "else",
          "do": "webhook",
          "connection": "my-oms",
          "body": {
            "symbol": "{{symbol}}",
            "decision": "allow",
            "p_drop5": "{{drop5}}",
            "as_of": "{{as_of}}"
          }
        }
      ],
      "dry_run": true
    }'

    Or inline in the order path, without a webhook. Decide what happens when the check itself fails (here: fail closed, the order waits):

    import os
    import requests
    
    URL = "https://oramodel.com/v1/systemone"
    HEADERS = {"Authorization": f"Bearer {os.environ['JEV_API_KEY']}"}
    
    QUESTIONS = {
        "drop5": {
            "type": "yes_no",
            "instructions": "Will it drop at least 5% at some point in the next month?"
        },
        "down_week": {
            "type": "yes_no",
            "instructions": "Will the stock be lower in a week?"
        },
        "below_50d": {
            "type": "yes_no",
            "ask": "C < sma(C,50)"
        }
    }
    
    def pre_trade_check(symbol):
        try:
            r = requests.post(URL, headers=HEADERS, timeout=10,
                              json={"model": "ora-fin1", "state": {"symbol": symbol}, "questions": QUESTIONS})
            r.raise_for_status()
        except requests.RequestException:
            return "hold", None                      # fail closed
        a = {k: v["yes_no"] for k, v in r.json()["answers"].items()}
        if a["drop5"] >= 0.6 and a["below_50d"] >= 0.6:
            return "block", a
        if a["drop5"] >= 0.6:
            return "reduce_size", a
        return "allow", a
  5. Act on it

    Make the guardrail advisory before it is binding: log its decision next to every order for a few weeks, compare with what happened, then let block stop orders. Keep a manual override, and record when it was used.

  6. Variations

    • Shorter horizon: add down_week to the block rule for short-term trades.
    • Sell-side check: block a short when rally5 is high.
    • Combine with the volatility multiplier so the size and the guardrail come from one request.

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.