mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
make bid/ask optional in PolygonStockQuoteWebSocketData
This commit is contained in:
@@ -77,7 +77,7 @@ The table below is not intended as a source of truth.
|
||||
|
||||
Availability will depend on the access level permitted by the provider's API key.
|
||||
|
||||
#### Usage
|
||||
#### Example
|
||||
|
||||
```python
|
||||
conn = obb.websockets.create_connection(provider="tiingo", asset_type="crypto", symbol="*", feed="trade", start_broadcast=True)
|
||||
|
||||
@@ -8,10 +8,7 @@ from typing import Any, Literal, Optional
|
||||
from openbb_core.app.model.abstract.error import OpenBBError
|
||||
from openbb_core.provider.abstract.data import Data
|
||||
from openbb_core.provider.abstract.fetcher import Fetcher
|
||||
from openbb_core.provider.utils.descriptions import (
|
||||
DATA_DESCRIPTIONS,
|
||||
QUERY_DESCRIPTIONS,
|
||||
)
|
||||
from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS
|
||||
from openbb_polygon.utils.constants import (
|
||||
CRYPTO_EXCHANGE_MAP,
|
||||
FX_EXCHANGE_MAP,
|
||||
@@ -775,18 +772,22 @@ class PolygonStockQuoteWebSocketData(WebSocketData):
|
||||
bid_exchange: str = Field(
|
||||
description="The exchange where the bid originated.",
|
||||
)
|
||||
bid_size: float = Field(
|
||||
bid_size: Optional[float] = Field(
|
||||
default=None,
|
||||
description="The size of the bid.",
|
||||
)
|
||||
bid: float = Field(
|
||||
bid: Optional[float] = Field(
|
||||
default=None,
|
||||
description="The bid price.",
|
||||
json_schema_extra={"x-unit_measurement": "currency"},
|
||||
)
|
||||
ask: float = Field(
|
||||
ask: Optional[float] = Field(
|
||||
default=None,
|
||||
description="The ask price.",
|
||||
json_schema_extra={"x-unit_measurement": "currency"},
|
||||
)
|
||||
ask_size: float = Field(
|
||||
ask_size: Optional[float] = Field(
|
||||
default=None,
|
||||
description="The size of the ask.",
|
||||
)
|
||||
ask_exchange: str = Field(
|
||||
|
||||
@@ -155,9 +155,11 @@ STOCK_QUOTE_CONDITIONS = {
|
||||
90: "Syndicate Bid",
|
||||
91: "Pre Syndicate Bid",
|
||||
92: "Penalty Bid",
|
||||
95: "CQS Generated",
|
||||
}
|
||||
|
||||
STOCK_QUOTE_INDICATORS = {
|
||||
1: "EXCHANGE_ACQUISITION",
|
||||
601: "NBBO_NO_CHANGE",
|
||||
602: "NBBO_QUOTE_IS_NBBO",
|
||||
603: "NBBO_NO_BB_NO_BO",
|
||||
|
||||
Reference in New Issue
Block a user