Drawing commands reference

All 26 drawing commands in AlgoBarsX, each with its parameters, defaults, ranges and an example: plot, fill, hline, mark, label, line, box, table, bar_color, background and 16 more.

plot fill hline mark label line box table bar_color background pane polygon polyline curve channel profile heatmap cells candles fib pitchfork arrow icon image tooltip dashboard

plot <series> [options]#

Draw a series.

Arguments

NameTypeDefaultWhat it is
seriesseries<number>requiredValues to draw.

Options

NameTypeDefaultRangeWhat it is
stylestringlineline, step, area, histogram, columns, circles or cross.
colorcolorblueColor.
widthint11 to 10Line width in pixels.
panestringpriceprice, new or a named pane.

Where it goes At the top level of an indicator or strategy.

Example
plot ema(close, 20) as fast, color: green, width: 2
strategyindicatorsince 1.0

fill <a> <b> [options]#

Fill between two plots or levels.

Arguments

NameTypeDefaultWhat it is
aseries<number>requiredFirst edge.
bseries<number>requiredSecond edge.

Options

NameTypeDefaultWhat it is
colorcolorblueColor.

Where it goes At the top level of an indicator or strategy.

Example
fill ema(close, 20), ema(close, 50), color: green.fade(80)
strategyindicatorsince 1.0

hline <value> [options]#

Horizontal level.

Arguments

NameTypeDefaultWhat it is
valuepricerequiredLevel.

Options

NameTypeDefaultWhat it is
stylestringdashedsolid, dashed or dotted.
colorcolorgrayColor.

Where it goes At the top level of an indicator or strategy.

Example
hline 70, style: dashed, color: red
strategyindicatorsince 1.0

mark <shape> [options]#

Marker on bars where a condition is true.

Arguments

NameTypeDefaultWhat it is
shapestringrequiredBuilt-in shape, emoji or SVG path.

Options

NameTypeDefaultWhat it is
atstring | pricebelowabove, below or a price.
whenbooltrueWhere to draw.
colorcolorblueColor.
sizestringsmalltiny, small, normal or large.

Where it goes At the top level of an indicator or strategy.

Example
mark arrow_up, at: below, when: crosses_above(close, ema(close, 20))
strategyindicatorsince 1.0

label <text> [options]#

Text at a bar and price.

Arguments

NameTypeDefaultWhat it is
textstringrequiredText.

Options

NameTypeDefaultWhat it is
attuple<bar | time, price>requiredBar and price.
stylestringnormalLabel style.
colorcolorblueColor.

Where it goes Anywhere a drawing statement is allowed.

Example
label "Entry", at: (bar.index, high)
strategyindicatorsince 1.0

line [options]#

Trend line or ray.

Options

NameTypeDefaultRangeWhat it is
fromtuple<bar | time, price>requiredStart point.
totuple<bar | time, price>requiredEnd point.
extendstringnonenone, left, right or both.
colorcolorblueColor.
widthint11 to 10Line width in pixels.

Where it goes Anywhere a drawing statement is allowed.

Example
line from: (bar.index - 20, low), to: (bar.index, low), extend: right
strategyindicatorsince 1.0

box [options]#

Rectangle or zone.

Options

NameTypeDefaultWhat it is
idstringautomaticId for updating the same box later.
fromtuple<bar | time, price>requiredOne corner.
totuple<bar | time, price>requiredOpposite corner.
colorcolorblueColor.
bordercolornoneBorder color.

Where it goes Anywhere a drawing statement is allowed.

Example
box from: (bar.index - 10, high), to: (bar.index, low), color: blue.fade(85)
strategyindicatorsince 1.0

table [options]#

On-chart table.

Options

NameTypeDefaultWhat it is
positionstringtop_rightCorner or edge of the chart.
rowslist<list<string>>requiredCell text by row.

Where it goes At the top level of an indicator or strategy.

Example
table position: top_right, rows: [["RSI", "{rsi(close, 14):0}"]]
strategyindicatorsince 1.0

bar_color <color>#

Recolor price bars.

Arguments

NameTypeDefaultWhat it is
colorcolorrequiredBar color.

Where it goes At the top level of an indicator or strategy.

Example
bar_color if close > open then green else red
strategyindicatorsince 1.0

background <color> [options]#

Shade the background.

Arguments

NameTypeDefaultWhat it is
colorcolorrequiredBackground color.

Options

NameTypeDefaultWhat it is
whenbooltrueWhere to shade.

Where it goes At the top level of an indicator or strategy.

Example
background red.fade(90), when: rsi(close, 14) > 70
strategyindicatorsince 1.0

pane <name> [options]#

Declare a named pane shared by several plots.

Arguments

NameTypeDefaultWhat it is
namestringrequiredPane name.

Options

NameTypeDefaultWhat it is
heightpercent25%Share of the chart height.

Where it goes At the top level of an indicator.

Example
pane "Oscillators", height: 30%
strategyindicatorsince 1.0

polygon [options]#

Closed shape.

Options

NameTypeDefaultWhat it is
pointslist<tuple<bar | time, price>>requiredCorner points.
fillcolornoneFill color.
bordercolorblueBorder color.

Where it goes Anywhere a drawing statement is allowed.

Example
polygon points: [(bar.index - 5, high), (bar.index, low), (bar.index - 5, low)], fill: blue.fade(80)
strategyindicatorsince 1.0

polyline [options]#

Open multi-segment line.

Options

NameTypeDefaultRangeWhat it is
pointslist<tuple<bar | time, price>>requiredPoints in order.
colorcolorblueColor.
widthint11 to 10Line width in pixels.

Where it goes Anywhere a drawing statement is allowed.

Example
polyline points: [(bar.index - 10, low), (bar.index - 5, high), (bar.index, low)]
strategyindicatorsince 1.0

curve [options]#

Smoothed curve through points.

Options

NameTypeDefaultRangeWhat it is
pointslist<tuple<bar | time, price>>requiredPoints in order.
smoothnumber0.50 to 1Smoothing from 0 to 1.
colorcolorblueColor.

Where it goes Anywhere a drawing statement is allowed.

Example
curve points: [(bar.index - 10, low), (bar.index - 5, high), (bar.index, low)], smooth: 0.5
strategyindicatorsince 1.0

channel [options]#

Channel between two series with a fill.

Options

NameTypeDefaultWhat it is
upperseries<price>requiredUpper edge.
lowerseries<price>requiredLower edge.
fillfillblue.fade(85)Fill color or gradient.

Where it goes At the top level of an indicator or strategy.

Example
channel upper: bollinger(close).upper, lower: bollinger(close).lower, fill: blue.fade(85)
strategyindicatorsince 1.0

profile [options]#

Horizontal histogram on the price axis (volume profile, market profile).

Options

NameTypeDefaultRangeWhat it is
rowsint242 to 1000Price rows.
rangestringvisiblevisible, session or fixed.
sidestringrightleft or right.
value_areapercent70%Value area share.

Where it goes At the top level of an indicator.

Example
profile rows: 24, range: session, side: right
strategyindicatorsince 1.0

heatmap [options]#

Price-by-time heatmap.

Options

NameTypeDefaultWhat it is
cellslist<Cell>requiredCells with bar, price and value.
palettestring"thermal"Color palette.

Where it goes At the top level of an indicator.

Example
heatmap cells: liquidity_cells, palette: "thermal"
strategyindicatorsince 1.0

cells [options]#

Cell grid inside each bar (footprint style).

Options

NameTypeDefaultWhat it is
rowslist<list<string>>requiredCell text by row.
columnsint2Columns per bar.

Where it goes At the top level of an indicator.

Example
cells rows: footprint_rows, columns: 2
strategyindicatorsince 1.0

candles [options]#

Custom candles in any pane.

Options

NameTypeDefaultWhat it is
openseries<number>requiredOpen.
highseries<number>requiredHigh.
lowseries<number>requiredLow.
closeseries<number>requiredClose.
colorcolorblueColor.
panestringnewprice, new or a named pane.

Where it goes At the top level of an indicator.

Example
candles open: open - close_of(GBPUSD), high: high - close_of(GBPUSD), low: low - close_of(GBPUSD), close: close - close_of(GBPUSD)
strategyindicatorsince 1.0

fib [options]#

Fibonacci retracement or extension.

Options

NameTypeDefaultWhat it is
fromtuple<bar | time, price>requiredSwing start.
totuple<bar | time, price>requiredSwing end.
levelslist<number>[0.236, 0.382, 0.5, 0.618, 0.786]Levels to draw.

Where it goes Anywhere a drawing statement is allowed.

Example
fib from: (bar.index - 50, lowest(low, 50)), to: (bar.index, highest(high, 50))
strategyindicatorsince 1.0

pitchfork [options]#

Andrews pitchfork.

Options

NameTypeDefaultWhat it is
pointslist<tuple<bar | time, price>>requiredThree anchor points.

Where it goes Anywhere a drawing statement is allowed.

Example
pitchfork points: [(bar.index - 30, low), (bar.index - 20, high), (bar.index - 10, low)]
strategyindicatorsince 1.0

arrow [options]#

Arrow between two points.

Options

NameTypeDefaultWhat it is
fromtuple<bar | time, price>requiredTail.
totuple<bar | time, price>requiredHead.
colorcolorblueColor.

Where it goes Anywhere a drawing statement is allowed.

Example
arrow from: (bar.index - 5, high), to: (bar.index, close)
strategyindicatorsince 1.0

icon <name> [options]#

Icon glyph.

Arguments

NameTypeDefaultWhat it is
namestringrequiredIcon name.

Options

NameTypeDefaultWhat it is
attuple<bar | time, price>requiredBar and price.
colorcolorblueColor.

Where it goes Anywhere a drawing statement is allowed.

Example
icon "flag", at: (bar.index, high)
strategyindicatorsince 1.0

image <asset> [options]#

Small image uploaded with the script.

Arguments

NameTypeDefaultWhat it is
assetstringrequiredAsset name.

Options

NameTypeDefaultRangeWhat it is
attuple<bar | time, price>requiredBar and price.
widthint244 to 512Width in pixels.

Where it goes Anywhere a drawing statement is allowed.

Example
image "logo", at: (bar.index, high), width: 24
strategyindicatorsince 1.0

tooltip <text> [options]#

Hover tooltip.

Arguments

NameTypeDefaultWhat it is
textstringrequiredTooltip text.

Options

NameTypeDefaultWhat it is
attuple<bar | time, price>requiredBar and price.

Where it goes Anywhere a drawing statement is allowed.

Example
tooltip "Swing high", at: (bar.index, high)
strategyindicatorsince 1.0

dashboard [options]#

Panel pinned to the screen that stays put while the chart scrolls.

Options

NameTypeDefaultWhat it is
positionstringtop_rightCorner or edge of the screen.
rowslist<list<string>>requiredCell text by row.

Where it goes At the top level of an indicator or strategy.

Example
dashboard position: top_right, rows: [["Trend", "up"]]
strategyindicatorsince 1.0

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account