Black Friday 30% off Basic and ProBlack Friday −30%Ends in––d––h––m––sSee the deal

Panes and scales

Where the indicator sits: on the price or in its own pane, with which scale and which numbers.

overlay

With overlay=True the indicator sits on the price pane. With overlay=False, the default, it creates a pane below, which disappears with the last indicator it contains. The user moves it to another pane from the legend, with “Move”.

scale

scaleScale
"auto"The price scale, if it sits on the price, or the pane’s. It’s the default.
"left", "right"The scale on that side
"none"No scale, only on the price: it fits the pane height by itself.

A pane can have several scales, on the right and on the left, and autoscale only looks at what is attached to each scale. The user changes it from the legend menu, with “Pin to scale”.

No scale, with margins

Without a scale the indicator doesn’t touch the price scale and shows no numbers on the axis. margins, (top, bottom) as percentages, sets the band it sits in: here is the volume in the lowest fifth of the chart.

The volume at the bottom, below the candles
scale="none" and margins=(80, 0): the volume below the candles.
Volume at the bottom
from totaltrade.v1 import indicator, request, plot, color

@indicator(short="Vol", overlay=True, scale="none", margins=(80, 0), format="quantity",
           plots=[plot.series("volume", "Volume", type="columns", color=[
               ("up", "Up", color("up", 50)),
               ("down", "Down", color("down", 50)),
           ])])
def calculate(bars=request.bars()):
    colors = ["up" if c >= o else "down" for o, c in zip(bars.open, bars.close)]
    return {"volume": (bars.volume, colors)}

name_labels

With name_labels=True, the name of each plot appears next to its last value label. The user can also turn them on and off, at the bottom of the Style tab.

The name labels next to the value labels
The name labels on the scale, next to the values.

format and precision

formatHow numbers are written
"price"Like the symbol’s prices; it’s the default
"quantity"Whole numbers below 10,000, then K, M and B, like volumes
"percent"With the percent sign

precision changes the decimals. They apply to legend, labels and axis, and each plot can have its own.