Models#
Bar#
- class alpaca.data.models.bars.Bar(symbol: str, raw_data: Dict[str, Any])#
Represents one bar/candlestick of aggregated trade data over a specified interval.
- symbol#
The ticker identifier for the security whose data forms the bar.
- Type:
str
- timestamp#
The closing timestamp of the bar.
- Type:
datetime
- open#
The opening price of the interval.
- Type:
float
- high#
The high price during the interval.
- Type:
float
- low#
The low price during the interval.
- Type:
float
- close#
The closing price of the interval.
- Type:
float
- volume#
The volume traded over the interval.
- Type:
float
- trade_count#
The number of trades that occurred.
- Type:
Optional[float]
- vwap#
The volume weighted average price.
- Type:
Optional[float]
- exchange#
The exchange the bar was formed on.
- Type:
Optional[float]
BarSet#
Quote#
- class alpaca.data.models.quotes.Quote(symbol: str, raw_data: Dict[str, Any])#
Level 1 ask/bid pair quote data. Contains information about size and origin exchange.
- symbol#
The ticker identifier for the security whose data forms the quote.
- Type:
str
- timestamp#
The time of submission of the quote.
- Type:
datetime
- ask_exchange#
The exchange the quote ask originates. Defaults to None.
- Type:
Optional[str, Exchange]
- ask_price#
The asking price of the quote.
- Type:
float
- ask_size#
The size of the quote ask.
- Type:
float
- bid_exchange#
The exchange the quote bid originates. Defaults to None.
- Type:
Optional[str, Exchange]
- bid_price#
The bidding price of the quote.
- Type:
float
- bid_size#
The size of the quote bid.
- Type:
float
- conditions#
The quote conditions. Defaults to None.
- Type:
Optional[List[str]]
- tape#
The quote tape. Defaults to None.
- Type:
Optional[str]
QuoteSet#
Trade#
- class alpaca.data.models.trades.Trade(symbol: str, raw_data: Dict[str, Any])#
A transaction from the price and sales history of a security.
- symbol#
The ticker identifier for the security whose data forms the trade.
- Type:
str
- timestamp#
The time of submission of the trade.
- Type:
datetime
- price#
The price that the transaction occurred at.
- Type:
float
- size#
The quantity traded
- Type:
float
- id#
The trade ID
- Type:
int
- conditions#
The trade conditions. Defaults to None.
- Type:
Optional[List[str]]
- tape#
The trade tape. Defaults to None.
- Type:
Optional[str]
TradeSet#
Snapshot#
Orderbook#
- class alpaca.data.models.orderbooks.Orderbook(symbol: str, raw_data: Dict[str, Any])#
Level 2 ask/bid pair orderbook data.
- symbol#
The ticker identifier for the security whose data forms the orderbook.
- Type:
str
- timestamp#
The time of submission of the orderbook.
- Type:
datetime
- bids#
The list of bid quotes for the orderbook
- Type:
List[OrderbookQuote]
- asks#
The list of ask quotes for the orderbook
- Type:
List[OrderbookQuote]
OrderbookQuote#
- class alpaca.data.models.orderbooks.OrderbookQuote(*, p: float, s: float)#
A single bid or ask quote in the orderbook