trade29.sc.SCBridge.subscribe_to_level1_quotes#
- SCBridge.subscribe_to_level1_quotes(key: str, update_frequency: int = -1)#
Subscribes to constant updates on quote data.
- Parameters:
- keystr
The key matching the key given to the SC-dX custom study in Sierra Chart.
- update_frequencyint, default -1
Frequency at which to send updates in milliseconds. Any value less than the chart update frequency will use the chart update frequency.
- Returns:
- int
A request id that can be used to filter the SCBridge’s
get_response_queue()
for account updates in the form ofLevel1QuotesResponse
.
Examples
from trade29.sc import SCBridge bridge = SCBridge() # Subscribe to quotes request_id = bridge.subscribe_to_level1_quotes(key = 'xx') response_queue = bridge.get_response_queue() while True: msg = response_queue.get() if msg.request_id == request_id: print(f"time: {msg.last_time}, last: {msg.last}, bid: {msg.bid}")