Skip to main content
v1.2.0

Removing drawing tools

Drawing tools can be removed from the chart via user interface, or in code.


Removing via user interface​

Any drawing tools can be removed by clicking the Remove button found in the drawing tool settings menu, that is brought up by right-clicking any of the tool's control points. Some drawing tools, such as horizontal and vertical lines, arrows and text elements, don't have control points. In these cases, right-clicking anywhere over the tool brings up the menu.

Removing drawing tools via UI

Amongst the settings buttons in the top-right corner, there is also Clear contents button. Clicking this opens various clearing options including a button to remove all added drawing tools from the chart.

Removing drawing tools in code​

Drawing tools can be removed in code can be done by calling dispose() method. The drawing tool must be saved as a variable beforehand.

# Add a Trend Line drawing tool to the trading chart
trend_line = trader.add_trend_line(startX=10, startY=30, endX=40, endY=20)

# Dispose of the trend line later when it's no longer needed
trend_line.dispose()

You can also remove all drawing tools simultaneously by calling dispose_all_drawing_tools() method.

trader.dispose_all_drawing_tools()