draw_shape
Draw lines, rectangles, text, and other shapes on TradingView charts with style overrides. Unknown shape names are refused to prevent accidental flags.
Instructions
Draw a shape/line on the chart. The created shape name is read back and an unrecognised name is REFUSED rather than silently becoming a flag.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text content for text shapes | |
| point | Yes | { time: unix_timestamp, price: number } | |
| shape | Yes | Shape type. Verified on Desktop 3.3.0: horizontal_line, vertical_line, horizontal_ray, ray, cross_line, trend_line, rectangle, text, note, callout, balloon, price_label, arrow_up, arrow_down, flag, long_position, short_position, fib_retracement, anchored_vwap, fixed_range_volume_profile. An unknown name is refused, not silently drawn as a flag. For long_position/short_position, overrides takes stopLevel and profitLevel IN TICKS plus riskDisplayMode and alwaysShowStats, and TradingView computes the R:R itself. | |
| point2 | No | Second point for two-point shapes (trend_line, rectangle) | |
| overrides | No | JSON string of style overrides (e.g., '{"linecolor": "#ff0000", "linewidth": 2}') |