trade29.sc.SCBridge.remove_chart_drawing#
- SCBridge.remove_chart_drawing(key: str, line_number: int, remove_user_drawn_drawing=False) ChartDrawingResponse #
Removes the chart drawing with the given line number.
- Parameters:
- keystr
The key matching the key given to the SC-dX custom study in Sierra Chart.
- line_numberint
The line number of the drawing to remove.
- Returns:
Examples
>>> from trade29.sc import SCBridge, ChartDrawing, color, constants >>> bridge = SCBridge() running bridge v0.17.0--------2024/08/08 16:44:07 connecting to sc starting receiver starting sender sc version: 2666, scdx version 208, connection: t29scdx2, keys: xx >>> data = bridge.get_chart_data(key = "xx", base_data = [constants.SCBaseData.SC_LAST], include_live_bar = False) >>> df = data.as_df(datetime_index = False, include_bar_index = True) >>> values = df["Last"] >>> indices = df["BarIndex"] >>> ret = bridge.add_chart_drawing( key="xx", drawing_type = ChartDrawing( constants.ChartDrawingType.LINE, line_width = 2, primary_color = color.MAGENTA, first_anchor_horizontal = indices[2], first_anchor_vertical = values[2], second_anchor_horizontal = indices[7], second_anchor_vertical = values[7]) >>> # We can get the line number of the drawing we just added >>> ret.line_number 80 >>> # Now we supply that line number as a parameter >>> ret = bridge.remove_chart_drawing(key = "xx", line_number = 80) >>> # Remove gives the same response as add and modify >>> ret.is_success True >>> ret.line_number 80