trade29.sc.SCBridge#
- class trade29.sc.SCBridge(connection='t29scdx2')#
Bridge between python API and SierraChart. Manages requests and responses with SierraChart.
This class connects on initialization to the custom SCDLL in SierraChart. There are two main method types: get methods and subscribe_to methods. Get methods simply return a corresponding Response object, while subscribe_to methods subscibe to recieving multiple reponses in the response queue. Subscribe_to methods return a request_id that can be used to filter the response queue (gotten through SCBridge.get_response_queue()) for relevant information.
- Parameters:
- connectionstr, default “t29scdx2”
A string that matches the connection name of the custom study in sierrachart. Should be left as the default unless connecting to multiple instances of SierraChart.
Methods
add_chart_drawing
(key, chart_drawing)Adds a drawing to the chart.
cancel_order
(key, order_id)Cancels an order by its ID
flatten_and_cancel
(key)Flattens position and cancels all active orders for chart with given key.
get_account_info
(key)Gets the status of the account position; including name, balance, currency, and alot more.
get_chart_data
(key[, sg_data, base_data, ...])Gets base or subgraph data from a chart
get_chart_drawings
(key[, drawing_types, ...])Gets chart drawings from the chart.
Gets info regarding the connection between SC-Py and the SC-dX Sierra Chart DLL.
get_filled_orders
(key)Gets data on filled orders from Sierra Chart.
Gets a list of flat to flat trades.
get_ohlc
(key[, historical_bars, ...])Gets OHLC data from a chart.
get_order_status
(key, order_id)Gets the status of an order.
get_position_status
(key)Gets the status of the account position; including quantity, average price, and open profit/loss.
get_response_queue
()Returns the response queue.
get_symbol_info
(key)Gets info of the current symbol; including name, tick size, and currency value per tick.
get_tpo_profile
(key, study_id[, ...])Gets historical TPO profiles from the TPO Profile Chart study.
modify_chart_drawing
(key, line_number, ...)Modifies a drawing on the chart.
modify_order
(key, order_id, quantity[, ...])Modifies the quantity or price settings of an order.
post_data_to_subgraph
(key, subgraph_id, ...)Sends data to a subgraph of an SC-dX study with a key.
remove_chart_drawing
(key, line_number[, ...])Removes the chart drawing with the given line number.
stop
()Stops all SCBridge threads.
submit_order
(key, is_buy, quantity[, ...])Submits an order.
subscribe_to_account_updates
(key[, ...])Subscribes to constant updates on the account position; including name, balance, currency, and alot more.
subscribe_to_chart_data
(key[, sg_data, ...])Subscribes to constant updates on base or subgraph data from a chart
subscribe_to_level1_quotes
(key[, ...])Subscribes to constant updates on quote data.
subscribe_to_market_depth
(key[, ...])Subscribes to constant snapshots of market depth data from chart with study with given key.
subscribe_to_order_updates
(key, order_id)Subscribes to updates on an order's status.
subscribe_to_position_updates
(key[, ...])Subscribes to updates on the account position; including quantity, average price, and open profit/loss.
Subscribes to time and sales for chart with given key.