---
title: "The last occurrences on a ticker, newest first"
method: GET
path: "/tickers/{symbol}/history"
tags: ["patterns"]
---

# The last occurrences on a ticker, newest first

`GET /tickers/{symbol}/history`

## Request

- Base URL: `https://api.tradingpal.io/api/v1`
- URL: `https://api.tradingpal.io/api/v1/tickers/{symbol}/history`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.tradingpal.io/oauth/authorize`, token URL `https://api.tradingpal.io/oauth/token`, scopes: `patterns`)

Returns the last occurrences of patterns on one ticker with what happened next, newest entry first: entry, stop, target, exit, realized move, R multiple and hold time. This is the receipt behind the ticker track record, not the full ledger: at most 5 rows. outcome narrows the rows to resolved (win or loss) or open trades; total says how many matched before the limit. Per-ticker samples are small, so quote the count beside any rate. The ticker does not need to be tracked.

## Path parameters

- `symbol` string, required

## Query parameters

- `limit` integer
- `outcome` 'all' | 'resolved' | 'open'

## Headers

- `X-TradingPal-Client` string

## Response `200`

OK

- History: Past occurrences of patterns on one symbol with what happened next.
  - `api_version` 'v1', required: The contract version, always v1. Field names in v1 do not change, and v1 stays available at least 12 months after a v2 ships.
  - `as_of_session` string, date, nullable, required: The last trading session the data describes, as an ISO date. Setups change nightly, so say it when presenting data and do not cache setups across days. Null on routes that do not read a dated artifact (account, tickers, history, families, universe and the demo index).
  - `data_version` string, nullable: Identifier of the stored artifact the answer came from: the candidate-book generation for patterns, the sealed manifest for family records. Null when the route reads no versioned artifact.
  - `source` object, required: Who produced the data. Constant on every response.
    - `name` string: Always "TradingPal".
    - `url` string, uri: Always https://tradingpal.io.
  - `disclaimer` 'Educational breakout-pattern analysis from TradingPal, not investment advice. Past results do not guarantee future outcomes.', required: The educational-use disclaimer, constant on every response. Repeat it when presenting a setup as something the user might act on.
  - `symbol` string: The symbol asked for, upper-cased.
  - `available` boolean: True when a current-schema pattern history is stored for the symbol. False when none is; occurrences is then empty and total is 0.
  - `occurrences` HistoryRow[]: The rows, newest entry first, after the outcome filter and the limit.
    - `setup_id` string, nullable: Identifier of the occurrence in the stored history. Null when the row carries none. It is not necessarily a setup_id the patterns route still serves.
    - `lineage_id` string, nullable: Identifier of the setup lineage: the connected set of breakout attempts of one pattern. attempt says where this row sits in it. Null when absent.
    - `family` string: The display family the row is filed under, derived from pattern_type: wedges keep their name, every triangle type is triangle, squeeze consolidations are bullish_pennant or bearish_pennant by direction, and anything else is other.
    - `family_label` string: Human-readable family name.
    - `pattern_type` string, nullable: The detector's pattern type for the row. Null when absent.
    - `direction` string, nullable: bullish or bearish. Null when the row carries neither a direction nor a bias.
    - `outcome` 'win' | 'loss' | 'open': How the trade ended: win (target reached), loss (stop hit, or target and stop in the same bar) or open (still running as of the last session).
    - `entry_date` string, date, nullable: Session date of the entry bar, as an ISO date. Null when absent.
    - `entry_price` number, nullable: Entry price in dollars: the close of the breakout bar.
    - `stop_price` number, nullable: The stop in dollars, frozen at entry.
    - `target_price` number, nullable: The measured-move target in dollars.
    - `exit_date` string, date, nullable: Session date of the exit bar, as an ISO date. Null for open trades.
    - `exit_price` number, nullable: Exit price in dollars. Null for open trades.
    - `realized_move_pct` number, nullable: Signed price move from entry to exit as a percent of the entry price, positive when in the trade's favour. Null when no exit is recorded.
    - `target_move_pct` number, nullable: The pattern's measured move as a percent of price: the size of the move the target was projected from. Null when the row carries none.
    - `r_multiple` number, nullable: Realized result in R: exit minus entry, divided by the entry-to-stop distance, signed by direction. Null for open trades.
    - `unrealized_r` number, nullable: For open trades only, the R at the last close walked. Null on resolved rows.
    - `hold_bars` integer, nullable: Daily bars (sessions) from entry to exit. Null for open trades.
    - `attempt` object: Where this row sits among the breakout attempts of its lineage.
      - `number` integer, nullable: The 1-based attempt number within the lineage. The history lists each lineage's first attempt, so this is 1 on served rows. Null when the row has no lineage data.
      - `count` integer, nullable: How many breakout attempts the lineage made in total. Null when the row has no lineage data.
  - `count` integer: Number of rows in occurrences.
  - `total` integer: Number of rows matching the outcome filter before the limit was applied.

## Other responses

- `400`: bad_request (limit is not an integer, or outcome is not all, resolved or open)
- `401`: missing_api_key (no Authorization: Bearer tp_live_… header) or invalid_api_key (unknown, revoked, or the account is inactive)
- `403`: forbidden (the account is not on Premium+, the plan with API access)
- `429`: rate_limited; wait details.retry_after_seconds

---

[API](https://skmtc.dev/tradingpal/apis/tradingpal-pattern-api.md) · [All operations](https://skmtc.dev/tradingpal/apis/tradingpal-pattern-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tradingpal/apis/tradingpal-pattern-api/revisions/e96e1f20c1ce?raw)
