Draw on the chart
The app draws on a chart.
Details#
Draw one native drawing on one chart: a trend line, ray, horizontal level, channel, pitchfork, Fibonacci or Gann tool, harmonic or Elliott wave pattern, shape, measuring tool, position or text label. It is saved with the member's own drawings for that market on that layout, exactly like a drawing they made by hand: it shows on every timeframe of that market (unless show_on limits it), stays after a reload, and the member can move, edit or delete it on the chart. An open chart showing that layout and market draws it at once. symbol, venue and kind name the market exactly as for open_chart (that venue, never another one); omit symbol to use the market the layout shows now (refused with missing_symbol when it shows none). Omit layout for the layout the member has open (Default when no chart is open); layout Default is the member's own chart, and any other name is one of the member's layouts from list_layouts. Before you use a tool for the first time, call list_drawing_tools with tool set to it: it gives the tool's points and their roles, the rules the points must satisfy, exactly what is drawn and where its text sits, its style keys with their defaults, its options and a worked example. Follow it exactly. Rules for every drawing: A drawing belongs to one market on one layout and shows on every timeframe of that market (unless show_on limits it). It is saved with the member's own drawings and the member can move, edit or delete it on the chart like one they drew. points is a list of {time, price} objects in the order the tool lists them, even for a one-point tool. Each point may carry its role ("role": "start"); with roles the order does not matter. Every point needs both time and price unless the tool says a coordinate is derived. time: a UTC date "2026-11-18" (00:00 UTC), a UTC date and time "2026-11-18 14:00" (optionally with seconds, "UTC" or "Z"), an ISO 8601 time with an offset ("2026-11-18T09:00:00-05:00"), or unix seconds (1794960000 is 2026-11-18 00:00 UTC). Not milliseconds. Times are read back as ISO 8601 UTC. To sit exactly on a candle, give that candle's open time: 1H candles open on the hour, 4H candles at 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00 UTC, 1D candles at 00:00 UTC, 1W candles on Monday 00:00 UTC, 1M candles on the 1st at 00:00 UTC. A stock or ETF's 1D candle open time is that trading day at 00:00 UTC; read the exact times from read_chart when unsure. Horizontal position is by candle, not by clock: a time between two neighbouring candles' open times sits proportionally between them, so a market's closed hours or a weekend gap is one candle step. Before the first or after the last candle, steps continue at the chart's usual candle spacing. "Candle steps" in the tool texts means this. price: a number in the chart's quote currency (the prices read_chart returns), positive or negative, at most 1e15 in size. On a logarithmic price scale, lines between points are straight on screen, so a line's price between its points follows a constant ratio per candle step instead of a constant amount. Style keys and options a call leaves out take the tool's listed default; nothing is guessed. Keys a tool does not list are refused, with the allowed keys in the error. text is the label's words (up to 1000 characters; a line break "\n" starts a new line). The text_* style keys need text on tools that take text. locked: true stops the member dragging or deleting it by accident (they can unlock it). hidden: true keeps it saved but not drawn. show_on: a list of chart timeframes from 1H, 4H, 1D, 1W, 1M; the drawing is drawn only when the chart is on one of them. Leave it out (or send "all" on update) for every timeframe. After drawing, call list_drawings for the same chart and check the points, style and rendered values read back. They are exactly what is saved and drawn. Lines and direction: a trend line stops at its two points unless extend_left (past its earlier point to the left edge) or extend_right (past its later point to the right edge) is set; the tools that take those keys are trendline, fibretracement, fibextension. A ray (ray) and a horizontal ray (hray) always run from their start point to the right edge of the chart, with nothing drawn to the left of it. A horizontal line (hline) and an extended line (extendedline) always cross the whole chart. Examples (add symbol, venue and layout as needed). A level from the latest daily candle onward: a horizontal ray starts at that candle's open time and runs right, with nothing to its left (use the real date of the latest candle; read_chart gives it): {"tool":"hray","points":[{"role":"start","time":"2026-11-18","price":0.3}]} A trend line through two swing lows, extended to the right to project it (each point is a low candle's open time and its low): {"tool":"trendline","points":[{"role":"start","time":"2026-09-15","price":60250},{"role":"end","time":"2026-11-03","price":67900}],"style":{"extend_right":true}} A Fibonacci retracement of a move down, from the swing high (from: level 1 is drawn there) to the swing low (to: level 0 is drawn there), with five levels: {"tool":"fibretracement","points":[{"role":"from","time":"2026-10-06","price":126000},{"role":"to","time":"2026-11-04","price":98000}],"options":{"levels":[0,0.382,0.5,0.618,1]}} A labelled level across the whole chart (the label starts just right of the point's time, so give a recent candle's time to keep it on screen): {"tool":"hline","points":[{"role":"level","time":"2026-11-18","price":64000}],"text":"Weekly support"} The answer has layout, market and drawing: the drawing as saved, in the shape list_drawings reads back, with its id for update_drawing and delete_drawing. After drawing, call list_drawings for the same chart and check that points and rendered match what you intended; if they do not, fix it with update_drawing instead of drawing it again. For a simple level, line, zone, Fibonacci tool or label, draw it with this tool rather than writing a BullScript™ indicator: it is exact, it needs no script run, and the member can edit it like their own. Refusals: invalid_args names the argument in detail (argument, problem, and allowed or given), so fix that argument and call again; missing_symbol, pass symbol (and venue) or call open_chart on that layout first; market_not_found or spot_not_found, call search_markets and use a symbol and venue from it; layout_not_found, call list_layouts; drawings_too_large, the chart's drawings are at the size limit, so ask the member which drawings to delete. Style keys: color, width, line_style, fill_color, extend_left, extend_right, arrow_start, arrow_end, text_color, text_size, bold, italic. Each key's values and meaning are in the style argument; each tool takes only the keys list_drawing_tools lists for it, and a key you leave out keeps the tool's default. options holds the settings only some tools have, such as a Fibonacci tool's levels; list_drawing_tools gives each option's type, values, range and default. Tools with options: regressionchannel, fibretracement, fibextension, fibextensiontrend, fibfan, fibtimezones, fibchannel, fibspeedfan, trendfibtime, fibcircles, fibarcs, fibwedge, gannfan, gannbox, gannsquare, dedekind, sonic, supersonic, goldensonic, goldensupersonic, flagmark, iconstamp, datepricerange, position, anchoredvwap, fixedrangevp, fairvaluegap, orderblock, liquidity. text is required on text, note, callout, comment, signpost, where the label is the drawing; on other tools that take text it is an optional label, and a tool that takes no text refuses it. Tools by group, each as key (name; its points in order): lines: trendline (Trend Line; 2 points: start, end); ray (Ray; 2 points: start, through); extendedline (Extended Line; 2 points: first, second); infoline (Info Line; 2 points: from, to); trendangle (Trend Angle; 2 points: start, end); hline (Horizontal Line; 1 point: level); hray (Horizontal Ray; 1 point: start); vline (Vertical Line; 1 point: point); crossline (Cross Line; 1 point: point). channels: parallelchannel (Parallel Channel; 3 points: start, end, offset); disjointchannel (Disjoint Channel; 4 points: top_start, top_end, bottom_start, bottom_end); flattopbottom (Flat Top/Bottom; 3 points: start, end, flat); regressionchannel (Linear Regression; 2 points: start, end). pitchforks: pitchfork (Pitchfork; 3 points: pivot, second, third); schiffpitchfork (Schiff Pitchfork; 3 points: pivot, second, third); modifiedschiffpitchfork (Modified Schiff Pitchfork; 3 points: pivot, second, third); insidepitchfork (Inside Pitchfork; 3 points: pivot, second, third). fibonacci: fibretracement (Fib Retracement; 2 points: from, to); fibextension (Fib Extension; 2 points: start, end); fibextensiontrend (Trend-Based Fib Extension; 3 points: leg_start, leg_end, pullback); fibfan (Fib Fan; 2 points: origin, end); fibtimezones (Fib Time Zones; 2 points: start, unit); fibchannel (Fib Channel; 3 points: start, end, offset); fibspeedfan (Fib Speed Resistance Fan; 2 points: origin, end); trendfibtime (Trend-Based Fib Time; 3 points: leg_start, leg_end, pullback); fibcircles (Fib Circles; 2 points: center, edge); fibarcs (Fib Speed Resistance Arcs; 2 points: center, edge); fibwedge (Fib Wedge; 3 points: apex, radius, angle); fibspiral (Fib Spiral; 2 points: center, edge); gannfan (Gann Fan; 2 points: origin, end); gannbox (Gann Box; 2 points: origin, opposite); gannsquare (Gann Square; 2 points: origin, opposite). geometry: dedekind (Dedekind Tessellation; 2 points: c1, c2); sonic (Sonic; 2 points: d1, d2); supersonic (Supersonic; 2 points: d1, d2); goldensonic (Golden Sonic; 2 points: d1, d2); goldensupersonic (Golden Supersonic; 2 points: d1, d2). patterns: xabcd (XABCD Pattern; 5 points: X, A, B, C, D); cypher (Cypher; 5 points: X, A, B, C, D); gartley (Gartley; 5 points: X, A, B, C, D); bat (Bat; 5 points: X, A, B, C, D); butterfly (Butterfly; 5 points: X, A, B, C, D); crab (Crab; 5 points: X, A, B, C, D); shark (Shark; 5 points: X, A, B, C, D); abcd (ABCD Pattern; 4 points: A, B, C, D); elliottimpulse (Elliott Impulse Wave (1-5); 5 points: wave1, wave2, wave3, wave4, wave5); elliottcorrection (Elliott Correction Wave (ABC); 3 points: A, B, C); headshoulders (Head & Shoulders; 7 points: start, left_shoulder, neckline_left, head, neckline_right, right_shoulder, end). shapes: arrow (Arrow; 2 points: start, end); box (Rectangle; 2 points: corner1, corner2); ellipse (Ellipse; 2 points: c1, c2); triangle (Triangle; 3 points: v1, v2, v3); polyline (Polyline; 2 to 512 points [{time, price}, ...]); path (Path; 2 to 512 points [{time, price}, ...]); freehand (Brush; 2 to 512 points [{time, price}, ...]); highlighter (Highlighter; 2 to 512 points [{time, price}, ...]); circle (Circle; 2 points: center, edge); rotatedrect (Rotated Rectangle; 3 points: p1, p2, w); arc (Arc; 3 points: p1, p2, apex); curve (Curve; 3 points: p1, p2, control); arrowmarkup (Arrow Mark Up; 1 point: tip); arrowmarkdown (Arrow Mark Down; 1 point: tip). annotations: text (Text; 1 point: point); note (Note; 1 point: point); callout (Callout; 2 points: target, box); comment (Comment; 2 points: target, box); pricenote (Price Note; 2 points: target, box); pricelabel (Price Label; 1 point: point); signpost (Signpost; 2 points: base, sign). stamps: flagmark (Flag; 1 point: center); iconstamp (Icon; 1 point: center). measure: datepricerange (Date & Price Range; 2 points: from, to); position (Long/Short Position; 3 points: entry, stop, target); anchoredvwap (Anchored VWAP; 1 point: anchor); fixedrangevp (Fixed Range Volume Profile; 2 points: start, end). priceaction: fairvaluegap (Fair Value Gap; 1 point: candle); orderblock (Order Block; 1 point: candle); liquidity (Liquidity; 1 point: candle).
Inputs#
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Optional | Ticker or pair, for example BTCUSDT or AAPL. |
| venue | string | Optional | Optional venue, for example BINANCE, COINBASE, BITSTAMP or NASDAQ. BINANCE is Binance spot, not Binance futures. |
| kind | string | Optional | Optional. spot or perp. Omit to open a spot market. Perpetuals are only opened when kind is perp or the venue is a futures venue. |
| layout | string | Optional | Layout name from list_layouts, or "Default" (the member's own chart). Omit to use the layout the member has open, or Default when no chart is open. |
| tool | string | Required | Required. The tool's key, for example hray, trendline or fibretracement; its toolbar name, such as Horizontal Ray, also works. Every key is listed in this description and by list_drawing_tools. |
| points | array of object | Required | Required. The tool's points as a list, even for a one-point tool: each { time, price } with an optional role, in the order list_drawing_tools gives (or each with its role). |
| text | string | Optional | Optional label, up to 1000 characters; "\n" starts a new line. Required on text, note, callout, comment, signpost; refused on tools that take no text. |
| style | object | Optional | Optional. How it looks. Each tool takes only some of these keys (list_drawing_tools lists them with their defaults); a key you leave out keeps the tool's default, and a key the tool does not take is refused with the allowed keys. |
| options | object | Optional | Optional. Settings only some tools have, such as a Fibonacci tool's levels: an object of option keys from list_drawing_tools, each with the type, values and range it lists. Keys a tool does not take are refused with the allowed keys. |
| locked | boolean | Optional | Optional, default false. true locks it: the member cannot drag or delete it by accident (they can unlock it), and it cannot be moved or deleted through the connector until it is unlocked. |
| hidden | boolean | Optional | Optional, default false. true keeps it saved but not drawn. |
| show_on | array of 1H | 4H | 1D | 1W | 1M | Optional | Optional. Draw it only while the chart is on one of these timeframes (1H, 4H, 1D, 1W, 1M), for example ["1D", "1W"]. Omit to draw it on every timeframe. |