pywry.tvchart.models¶
Data models for the TradingView datafeed request/response protocol. These Pydantic models define symbol metadata, bar data, and the wire format for chart ↔ Python communication.
Symbol Metadata¶
pywry.tvchart.models.TVChartSymbolInfo
¶
Bases: BaseModel
Full TradingView symbol metadata (LibrarySymbolInfo).
Describes a tradeable instrument for the charting library. All fields
are optional except name.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Short symbol name (e.g. |
full_name |
str
|
Full symbol path ( |
base_name |
list of str or None
|
Underlying symbols for spread/expression instruments. |
ticker |
str or None
|
Unique symbol identifier used in datafeed requests. |
description |
str
|
Human-readable symbol description. |
type |
str
|
Instrument type ( |
session |
str
|
Trading session in HHMM format ( |
session_display |
str or None
|
Display-formatted session string. |
exchange |
str
|
Exchange name. |
listed_exchange |
str
|
Primary listing exchange. |
timezone |
str
|
IANA timezone (e.g. |
format |
str
|
Price display format ( |
pricescale |
int
|
Price precision denominator (100 = 2 decimals). |
minmov |
int
|
Minimum price movement numerator. |
has_intraday |
bool or None
|
Whether intraday resolutions are available. |
has_daily |
bool or None
|
Whether daily resolution is available. |
has_weekly_and_monthly |
bool or None
|
Whether weekly/monthly resolutions are available. |
supported_resolutions |
list of str or None
|
List of available resolutions (e.g. |
intraday_multipliers |
list of str or None
|
Intraday resolution multipliers. |
volume_precision |
int or None
|
Volume decimal precision. |
data_status |
str
|
Data availability ( |
currency_code |
str or None
|
Currency code for the instrument. |
Attributes¶
has_weekly_and_monthly
class-attribute
instance-attribute
¶
supported_resolutions
class-attribute
instance-attribute
¶
intraday_multipliers
class-attribute
instance-attribute
¶
seconds_multipliers
class-attribute
instance-attribute
¶
original_currency_code
class-attribute
instance-attribute
¶
unit_conversion_types
class-attribute
instance-attribute
¶
price_sources
class-attribute
instance-attribute
¶
subsessions
class-attribute
instance-attribute
¶
Bar Data¶
pywry.tvchart.models.TVChartSeriesData
¶
Bases: BaseModel
Normalized bar data for a single series.
Attributes:
| Name | Type | Description |
|---|---|---|
series_id |
str
|
Unique identifier for this series. |
bars |
list[dict]
|
OHLC or value bars with time key. |
volume |
list[dict]
|
Volume bars with time and value keys. |
series_type |
SeriesType
|
Chart series type (candlestick, line, etc.). |
has_volume |
bool
|
Whether volume data is available. |
total_rows |
int
|
Original row count before truncation. |
truncated_rows |
int
|
Number of rows dropped due to max_bars limit. |
pywry.tvchart.models.TVChartData
¶
Bases: BaseModel
Container for normalized chart data, possibly multi-series.
Attributes:
| Name | Type | Description |
|---|---|---|
series |
list[TVChartSeriesData]
|
One or more series of bar data. |
columns |
list[str]
|
Original column names from the input data. |
time_column |
str
|
Name of the column used for time. |
symbol_column |
str or None
|
Name of the column used for multi-series grouping. |
is_multi_series |
bool
|
Whether there are multiple series. |
source_format |
str
|
Detected format: 'single', 'narrow', 'wide', 'multiindex'. |
column_types |
dict[str, str]
|
Column name to dtype string mapping. |
Attributes¶
series
class-attribute
instance-attribute
¶
series: list[TVChartSeriesData] = Field(default_factory=list)
column_types
class-attribute
instance-attribute
¶
Datafeed Requests (JS → Python)¶
pywry.tvchart.models.TVChartDatafeedConfigRequest
¶
Bases: BaseModel
Frontend request for datafeed configuration (onReady).
pywry.tvchart.models.TVChartDatafeedSearchRequest
¶
Bases: BaseModel
Frontend request for symbol search suggestions.
pywry.tvchart.models.TVChartDatafeedResolveRequest
¶
Bases: BaseModel
Frontend request for full metadata of a specific symbol.
pywry.tvchart.models.TVChartDatafeedHistoryRequest
¶
Bases: BaseModel
Frontend request for historical bars (getBars).
pywry.tvchart.models.TVChartDatafeedSubscribeRequest
¶
Bases: BaseModel
Frontend request to start real-time bar updates (subscribeBars).
pywry.tvchart.models.TVChartDatafeedUnsubscribeRequest
¶
Bases: BaseModel
Frontend request to stop real-time bar updates (unsubscribeBars).
pywry.tvchart.models.TVChartDatafeedMarksRequest
¶
Bases: BaseModel
Frontend request for chart marks (getMarks).
pywry.tvchart.models.TVChartDatafeedTimescaleMarksRequest
¶
Bases: BaseModel
Frontend request for timescale marks (getTimescaleMarks).
pywry.tvchart.models.TVChartDatafeedServerTimeRequest
¶
Bases: BaseModel
Frontend request for server time.