Skip to content
Drawings and Overlays

Create Drawing

Saves a new drawing for the current user. Call it once per shape after the user finishes drawing on the K-line chart. When several shapes are finished at once, the Broker App calls it for each shape and, after the last call succeeds, calls GET /v1/watchlist/draw_shapes again to get the full list with server-assigned IDs. Submitting the same drawing twice creates a duplicate. If the call fails, the drawing is not saved; ask the user to try again.

POSThttps://api.lbkrs.com/v1/watchlist/draw_shapes

Request body application/json

counter_idstringrequired

Security ID

kline_typeintegerrequired

K-line period the drawing belongs to; same values as line_type in GET /v3/quote/kline

timestamp_minintegerrequired

Earliest time the drawing covers as a Unix timestamp in seconds; the smallest control point time

timestamp_maxintegerrequired

Latest time the drawing covers as a Unix timestamp in seconds; the largest control point time

shape_dataobjectrequired

Drawing shape data. The chart component generates this object, and a read returns it to the chart component as-is to restore the drawing. Fields not listed here must also be saved and returned unchanged.

Child attributes
shape_typeinteger

Shape type defined by the chart component (such as line, ray, or channel)

control_pointsarray<object>

Control points of the shape, in drawing order

Child attributes
xstring

Time of the control point as a Unix timestamp in seconds, in string form

ystring

Price of the control point

total_control_pointsinteger

Total number of control points the shape needs

finishedboolean

Whether the shape is complete

color_strstring

Line color as a hex value, such as #37A0FF

line_widthinteger

Line width

line_styleinteger

Line style defined by the chart component

Responses

HTTP 200The request succeeded. A code of 0 means the drawing was saved. To get the drawing ID, call the list endpoint again.
codeintegerrequired

Business status code, 0 indicates success

messagestringrequired

Human-readable result or error message.

Whale Docs