Skip to content

IBaseData

QuantConnect.Data.IBaseData

Bases: ISymbolProvider

Base Data Class: Type, Timestamp, Key -- Base Features.

data_type

data_type: MarketDataType

Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.

time

time: datetime

Time keeper of data -- all data is timeseries based.

end_time

end_time: datetime

End time of data

value

value: float

All timeseries data is a time-value pair:

price

price: float

Alias of Value.

symbol

symbol: Symbol

Gets the Symbol

clone

clone() -> BaseData

Return a new instance clone of this object

reader

reader(
    config: SubscriptionDataConfig,
    line: str,
    date: datetime,
    is_live_mode: bool,
) -> BaseData

Reader converts each line of the data source into BaseData objects. Each data type creates its own factory method, and returns a new instance of the object each time it is called. The returned object is assumed to be time stamped in the config.ExchangeTimeZone.

Parameters:

Name Type Description Default
config SubscriptionDataConfig

Subscription data config setup object

required
line str

Line of the source document

required
date datetime

Date of the requested data

required
is_live_mode bool

true if we're in live mode, false for backtesting mode

required

Returns:

Type Description
BaseData

Instance of the T:BaseData object generated by this line of the CSV.

requires_mapping

requires_mapping() -> bool

Indicates if there is support for mapping

Returns:

Type Description
bool

True indicates mapping should be used.