Skip to content

OHLCV Data

The ohlcv realtime stream delivers continuously updating OHLCV candle buckets for supported symbols at the requested interval.

LLM guidance

Use this page when the application needs the current interval candle updated in realtime. This stream does not return prior interval history. Use Historical Market Data for retrospective time-window queries.

Basic Usage

from nubra_python_sdk.ticker import websocketdata
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv

nubra = InitNubraSdk(NubraEnv.PROD, env_creds=True)

def on_ohlcv_data(msg):
    print("[OHLCV]", msg)

def on_connect(msg):
    print("[status]", msg)

def on_close(reason):
    print(f"Closed: {reason}")

def on_error(err):
    print(f"Error: {err}")

socket = websocketdata.NubraDataSocket(
    client=nubra,
    on_ohlcv_data=on_ohlcv_data,
    on_connect=on_connect,
    on_close=on_close,
    on_error=on_error,
)

socket.connect()
socket.subscribe(["NIFTY", "HDFCBANK"], data_type="ohlcv", interval="10m", exchange="NSE")
socket.keep_running()

Supported Intervals

  • 1m
  • 2m
  • 3m
  • 5m
  • 10m
  • 15m
  • 30m
  • 1h
  • 2h
  • 4h
  • 1d
  • 1wk
  • 1mt

Subscription Contract

Parameter Type Required Meaning
symbols list[str] yes supported index or stock symbols
data_type str yes must be ohlcv
interval str yes candle interval
exchange str no exchange override

Response Shape

class OhlcvDataWrapper:
    indexname: str
    exchange: str
    interval: str
    timestamp: int
    open: int
    high: int
    low: int
    close: int
    bucket_volume: int
    tick_volume: int
    cumulative_volume: int
    bucket_timestamp: int

Response Contract

Field Type Meaning
indexname str subscribed symbol
exchange str exchange name
interval str candle interval
timestamp int candle close timestamp
open int candle open
high int candle high
low int candle low
close int candle close
bucket_volume int traded volume for the candle bucket
tick_volume int tick-level update volume
cumulative_volume int session cumulative volume
bucket_timestamp int candle start timestamp

Implementation Notes

  • Each update represents the stream's candle bucket data, not a one-time historical query.
  • The stream provides the current interval candle data in realtime, not a historical series of prior interval buckets.
  • Use Historical Market Data for retrospective time-window queries.
  • Price fields are returned in exchange-native units where applicable.

Important Rules

  • This is a realtime stream, not a snapshot API.
  • interval must match one of the supported values exactly.
  • OHLCV streaming gives the current interval candle updates in realtime, not prior days or historical interval series.
  • Use OHLCV streaming for live candle updates and historical data APIs for retrospective windows.
  • Review Subscription Limits before opening large numbers of subscriptions.
  1. Realtime Data
  2. Subscription Limits
  3. Historical Market Data
NEO Assistant