> For the complete documentation index, see [llms.txt](https://statalpha.gitbook.io/statalpha-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://statalpha.gitbook.io/statalpha-docs/stats/odc.md).

# ODC

The **Opening Day Continuation (ODC)** module evaluates how often the market direction in the early minutes of a session continues throughout the trading day.\
It measures the **follow rate**, **strength ratio**, and **volume share** for different starting intervals — e.g., 5, 10, 15, 30, or 60 minutes after the open.

***

## Concept

* Tests whether the direction of the early intervals (e.g., first 5, 10, 15 minutes) continues during the full day.
* Quantifies **directional consistency**, **volatility**, and **volume allocation** for each interval.
* Evaluates both **bullish (green)** and **bearish (red)** starts separately.
* Includes performance breakdown by:
  * Follow rate (% of sessions where early move direction matched the day’s close)
  * Range contribution (how much of the daily range was already covered)
  * Volume share of early intervals
  * False-positive rate (green start → red day)

***

## Parameters

| Parameter                 | Type       | Description                                                         |
| ------------------------- | ---------- | ------------------------------------------------------------------- |
| `symbol`                  | string     | Target symbol (e.g., `AAPL`, `TSLA`, `BTCUSD`)                      |
| `interval_minutes`        | list\[int] | Minutes after open to evaluate (e.g., `5`, `10`, `15`, `30`, `60`)  |
| `start_date` / `end_date` | string     | Custom date range (`YYYY-MM-DD`)                                    |
| `time_window`             | string     | Predefined time window (e.g., `1M`, `3M`, `6M`, `12M`, `24M`, `5Y`) |
| `start_time` / `end_time` | string     | Intraday session window (default `13:30`–`20:00` UTC)               |
| `include_extended_hours`  | bool       | Include pre-/post-market data if `true`                             |
| `limit`                   | int        | Limits the number of results for `/top` and `/flop` endpoints       |
| `sort`                    | string     | Sorting key for `/top` and `/flop` (e.g., `green_follow_rate_pct`)  |

***

## Endpoints

| Endpoint                  | Description                                                                         |
| ------------------------- | ----------------------------------------------------------------------------------- |
| `GET /stats/odc`          | Returns per-day interval metrics (price, volume, direction, range)                  |
| `GET /stats/odc/summary`  | Aggregated metrics per interval (green/red start, follow rate, volume share, range) |
| `GET /stats/odc/top`      | Best intervals ranked by follow rate or chosen metric                               |
| `GET /stats/odc/flop`     | Weakest intervals ranked by lowest follow rate                                      |
| `GET /stats/odc/errors`   | False-positive analysis (green start → red day)                                     |
| `GET /stats/odc/momentum` | Average interval return percentage                                                  |
| `GET /stats/odc/doc`      | Field documentation for all endpoints                                               |

***

## Example Requests

### 1. Retrieve summary statistics

```bash
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.statalpha.market/stats/odc/summary?symbol=TSLA&interval_minutes=5&interval_minutes=15&time_window=12M"
```

### 2. Get top-performing intervals

```bash
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.statalpha.market/stats/odc/top?symbol=MSFT&interval_minutes=5&interval_minutes=10&limit=3&sort=green_follow_rate_pct"
```

### 3. Check weakest intervals

```bash
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.statalpha.market/stats/odc/flop?symbol=AAPL&interval_minutes=5&interval_minutes=10&limit=3"
```

***

## Example Response (summary excerpt)

```json
[
  {
    "interval_minutes": 5,
    "green": {
      "count_start": 132,
      "follow_rate_pct": 62.8,
      "avg_interval_range_pct": 0.92,
      "avg_interval_volume_share": 7.8
    },
    "red": {
      "count_start": 128,
      "follow_rate_pct": 58.4,
      "avg_interval_range_pct": 0.86,
      "avg_interval_volume_share": 8.1
    },
    "time_window": "12M"
  }
]
```

***

## Interpretation

| Metric                                              | Meaning                                                               |
| --------------------------------------------------- | --------------------------------------------------------------------- |
| **green.follow\_rate\_pct / red.follow\_rate\_pct** | Share of sessions where early interval direction matched day’s close  |
| **avg\_interval\_range\_pct**                       | Average volatility during the interval relative to the day’s open     |
| **avg\_interval\_volume\_share**                    | Share of daily volume traded within the interval                      |
| **avg\_interval\_vs\_day\_range\_pct**              | Portion of the day’s total range already reached in the interval      |
| **false\_positive\_rate\_percent**                  | Rate of failed continuations (green start → red day)                  |
| **avg\_interval\_return\_percent**                  | Average return between open and interval end                          |
| **same\_direction\_rate\_percent**                  | How often the early interval and full day moved in the same direction |

***

## Notes

* ODC statistics help identify **time-based continuation patterns** useful for intraday timing or model calibration.
* All users can access the same metrics; plan differences apply only to query flexibility.
* Cached results are returned for repeated requests for consistent performance.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://statalpha.gitbook.io/statalpha-docs/stats/odc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
