> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequency.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Get compression statistics

> Get aggregated compression statistics for a stock.

## Response Data

- NR7 count in period
- Inside day count
- Average/min/max compression ratio
- Average compression score
- Trend direction (compressing/expanding/stable)

## Query Parameters

- **days**: Number of days for statistics (default: 30)

## Performance Target

<200ms response time.



## OpenAPI

````yaml /api/openapi.json get /api/graph/v1/stocks/{symbol}/compression/stats
openapi: 3.1.0
info:
  title: Sequency Graph API
  description: >

    # Sequency Graph-Native Trading API


    Graph-native API for trading intelligence, built on FalkorDB.


    ## Features


    - **Screener**: Filter stocks using graph-native queries with relationship
    expansion

    - **Stock Detail**: Complete stock context with all relationships

    - **Confluence Scoring**: Setup quality assessment with weighted components

    - **Strategy Matching**: Find matching options strategies via graph
    traversal

    - **Market Context**: Current market-wide context for trading decisions


    ## Data Sources


    All data is sourced from the FalkorDB knowledge graph, populated by:

    - Pattern detector (Go) - Technical indicators, patterns

    - Graph sync service - Levels, volume profiles, news, day classification
  version: 1.0.0
servers: []
security: []
paths:
  /api/graph/v1/stocks/{symbol}/compression/stats:
    get:
      tags:
        - Compression
      summary: Get compression statistics
      description: |-
        Get aggregated compression statistics for a stock.

        ## Response Data

        - NR7 count in period
        - Inside day count
        - Average/min/max compression ratio
        - Average compression score
        - Trend direction (compressing/expanding/stable)

        ## Query Parameters

        - **days**: Number of days for statistics (default: 30)

        ## Performance Target

        <200ms response time.
      operationId: get_compression_stats_api_graph_v1_stocks__symbol__compression_stats_get
      parameters:
        - name: symbol
          in: path
          required: true
          schema:
            type: string
            title: Symbol
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 365
            minimum: 1
            title: Days
            description: Lookback period in days
            default: 30
          description: Lookback period in days
      responses:
        '200':
          description: Compression statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompressionStats'
        '404':
          description: Stock not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CompressionStats:
      properties:
        symbol:
          type: string
          title: Symbol
          description: Stock ticker symbol
        period_days:
          type: integer
          title: Period Days
          description: Number of days analyzed
        nr7_count:
          type: integer
          title: Nr7 Count
          description: Number of NR7 days in period
          default: 0
        inside_day_count:
          type: integer
          title: Inside Day Count
          description: Number of inside days in period
          default: 0
        total_events:
          type: integer
          title: Total Events
          description: Total compression events in period
          default: 0
        avg_compression_ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Compression Ratio
          description: Average ATR compression ratio over period
        min_compression_ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Compression Ratio
          description: Minimum (most compressed) ratio
        max_compression_ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Compression Ratio
          description: Maximum (least compressed) ratio
        avg_compression_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Compression Score
          description: Average composite compression score
        trend_direction:
          type: string
          enum:
            - compressing
            - expanding
            - stable
          title: Trend Direction
          description: Volatility trend based on recent vs earlier period comparison
          default: stable
      type: object
      required:
        - symbol
        - period_days
      title: CompressionStats
      description: Aggregated compression statistics for a symbol over a period.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````