> 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/pdhlb.md).

# PDHLB

The **Previous Day High/Low Break (PDHLB)** module tracks how often price breaks the previous day’s high or low, measures follow-through, and analyzes retests and breakout strength.\
It provides valuable insights for **opening range setups**, **trend continuation**, and **false-break detection**.

***

## Concept

* Detects when price **exceeds the previous day’s high or low**.
* Measures **follow-through strength**, **retest probability**, and **duration** above/below those levels.
* Calculates **volume ratios**, **relative volatility**, and a **breakout strength score** for both directions.
* Summarizes how consistent such breakouts are over time, including streaks and false-break frequency.

***

## Parameters

| Parameter                 | Type   | Description                                                       |
| ------------------------- | ------ | ----------------------------------------------------------------- |
| `symbol`                  | string | Asset symbol (e.g. `AAPL`, `BTCUSD`)                              |
| `start_date` / `end_date` | string | Date range (`YYYY-MM-DD`)                                         |
| `time_window`             | string | Predefined time range (e.g. `1M`, `3M`, `6M`, `12M`, `24M`, `5Y`) |
| `start_time` / `end_time` | string | UTC intraday range (default `13:30`–`20:00`)                      |
| `include_extended_hours`  | bool   | Include pre-/post-market data                                     |
| `direction`               | string | For `/top` and `/retest`, choose `high`, `low`, or `both`         |
| `limit`                   | int    | Max number of records to return (default `10`)                    |

***

## Endpoints

| Endpoint                   | Description                                                                     |
| -------------------------- | ------------------------------------------------------------------------------- |
| `GET /stats/pdhlb`         | Returns raw day-by-day breakout data with all metrics                           |
| `GET /stats/pdhlb/summary` | Aggregated metrics (follow-through averages, retest rates, volume ratios, etc.) |
| `GET /stats/pdhlb/top`     | Top breakout days by move size (`high` or `low`)                                |
| `GET /stats/pdhlb/retest`  | Days where price retested previous day’s level after breakout                   |
| `GET /stats/pdhlb/doc`     | Returns field documentation for all PDHLB endpoints                             |

***

## Example Requests

### 1. Retrieve raw breakout data

```bash
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.statalpha.market/stats/pdhlb?symbol=AAPL&time_window=12M"
```

### 2. Get summary statistics

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

### 3. Find top breakout days (highs)

```bash
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.statalpha.market/stats/pdhlb/top?symbol=TSLA&direction=high&limit=5"
```

### 4. Find all days with retests

```bash
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://api.statalpha.market/stats/pdhlb/retest?symbol=MSFT&time_window=12M"
```

***

## Example Response (summary excerpt)

```json
{
  "symbol": "AAPL",
  "total_days": 252,
  "high_breaks": 138,
  "low_breaks": 121,
  "both_broken_same_day": 36,
  "avg_follow_through_high_pct": 0.84,
  "avg_follow_through_low_pct": 0.73,
  "retest_rate_high_pct": 57.3,
  "retest_rate_low_pct": 51.8,
  "avg_time_to_max_follow_through_high_min": 38.2,
  "avg_time_to_max_follow_through_low_min": 42.7,
  "avg_duration_above_prev_high_min": 112.5,
  "avg_duration_below_prev_low_min": 94.3,
  "high_break_success_rate_pct": 74.6,
  "false_breakout_rate_high_pct": 13.8,
  "avg_volume_ratio_high_break": 1.42,
  "avg_breakout_strength_score_high": 78.6,
  "avg_relative_close_vs_prev_close": 0.0042,
  "avg_relative_range_vs_prev_range": 1.18,
  "time_window": "12M"
}
```

***

## Interpretation

| Metric                                                            | Meaning                                                        |
| ----------------------------------------------------------------- | -------------------------------------------------------------- |
| **high\_breaks / low\_breaks**                                    | Number of sessions breaking previous high or low               |
| **avg\_follow\_through\_high\_pct / low\_pct**                    | Average % move after breakout                                  |
| **retest\_rate\_high\_pct / low\_pct**                            | Share of days that retested broken level                       |
| **avg\_duration\_above\_prev\_high\_min / below\_prev\_low\_min** | Duration in minutes spent beyond previous levels               |
| **avg\_time\_to\_max\_follow\_through\_high\_min / low\_min**     | Time (minutes) until max follow-through was reached            |
| **avg\_volume\_ratio\_high\_break / low\_break**                  | Relative volume intensity at breakout vs. average              |
| **avg\_breakout\_strength\_score\_high / low**                    | Composite score combining follow-through, duration, and volume |
| **false\_breakout\_rate\_high\_pct**                              | % of failed high breakouts without retest or continuation      |
| **avg\_relative\_close\_vs\_prev\_close**                         | Average daily close relative to previous day’s close           |
| **avg\_relative\_range\_vs\_prev\_range**                         | How the day’s volatility compares to the previous day’s range  |

***

## Notes

* PDHLB is one of the most used indicators for **continuation and reversal probability** analysis.
* Strong breakouts with retests and sustained volume often precede short-term trends.
* False breakouts tend to signal **range compression** or **trend exhaustion**.
* All users can access the same PDHLB endpoints; plan differences affect only query flexibility.


---

# 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/pdhlb.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.
