BrokerageMultiWebSocketEntry
QuantConnect.Brokerages.BrokerageMultiWebSocketEntry
BrokerageMultiWebSocketEntry(
symbol_weights: Dictionary[Symbol, int],
web_socket: IWebSocket,
)
BrokerageMultiWebSocketEntry(web_socket: IWebSocket)
Bases: Object
Helper class for BrokerageMultiWebSocketSubscriptionManager
Initializes a new instance of the BrokerageMultiWebSocketEntry class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol_weights
|
Optional[Dictionary[Symbol, int]]
|
A dictionary of symbol weights |
None
|
web_socket
|
IWebSocket
|
The web socket instance |
required |
total_weight
total_weight: int
Gets the sum of symbol weights for this web socket
symbol_count
symbol_count: int
Gets the number of symbols subscribed
add_symbol
add_symbol(
symbol: Union[Symbol, str, BaseContract],
) -> None
Adds a symbol to the entry
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
Union[Symbol, str, BaseContract]
|
The symbol to add |
required |
contains
contains(symbol: Union[Symbol, str, BaseContract]) -> bool
Returns whether the symbol is subscribed
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
Union[Symbol, str, BaseContract]
|
|
required |
remove_symbol
remove_symbol(
symbol: Union[Symbol, str, BaseContract],
) -> None
Removes a symbol from the entry
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
Union[Symbol, str, BaseContract]
|
The symbol to remove |
required |