curve

Draws a smooth curved line between two points, using a control point to bend the path. Perfect for highlighting flows, non-linear moves, or to give a more natural look to connections.

Syntax (one line)

curve(fromPoint, toPoint, curvePoint, styles?)

Parameters

fromPoint (PricedData) · Starting anchor of the curve. toPoint (PricedData) · Ending anchor of the curve. curvePoint (PricedData) · Control point that shapes the curvature. styles (BeziercubicLineToolOverrides) · Optional styling for the curve:

  • backgroundColor (RGBAColor | BaseColors) · Fill color for the background area.

  • extendLeft (boolean) · Extend the curve endlessly to the left.

  • extendRight (boolean) · Extend the curve endlessly to the right.

  • fillBackground (boolean) · Enable/disable area fill under the curve.

  • leftEnd (number) · Left ending style (arrow, flat, etc).

  • linecolor (RGBAColor | BaseColors) · Color of the curve line.

  • linestyle (number) · Line pattern (solid, dashed, dotted).

  • linewidth (number) · Thickness of the curve line.

  • rightEnd (number) · Right ending style (arrow, flat, etc).

  • transparency (number) · Transparency for fills and line.

Return Value

(string) · The drawing ID of the created curve.

Example

What this does: Every 50 candles, a red curve is drawn to connect two anchors with a midpoint bending the path.

Tips

  • The closer the control point is to one anchor, the more the curve bends near the other anchor.

  • Great for showing parabolic moves or soft transitions.

Warning

  • Avoid placing the control point exactly on the same line as the two anchors, otherwise it will look like a straight line.

Good Practice

  • Use consistent curve colors (for example: red for resistance arcs, green for support arcs).

  • Combine with doubleCurve for smoother patterns with two bends.

Last updated