Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: format · Entries: 6
format (library)
Definition
Named formats for script values: format.inherit, format.price, format.percent, format.volume and format.mintick. Pass one to the format argument of indicator, strategy or plot to control how values appear on the price scale and in the status line.
Example
format.inherit (constant)
Definition
A format for script values, for the format argument of indicator and strategy. Uses the format of the parent series: the price scale of the chart, or of the pane the script is drawn in. This is the default there. The plot functions (plot, hline, plotarrow, plotchar, plotshape) refuse it when the script is added to the chart: leave their format out.
Type
const string
Example
format.mintick (constant)
Definition
A format for script values, for the format argument of str.tostring. Shows values rounded to the instrument’s minimum tick. indicator, strategy and the plot functions pass it in the editor’s check but refuse it when the script is added to the chart.
Type
const string
Example
format.percent (constant)
Definition
A format for script values, for the format argument of indicator, strategy and the plot functions (plot, hline, plotarrow, plotchar, plotshape). Shows values as percentages, with a % sign.
Type
const string
Example
format.price (constant)
Definition
A format for script values, for the format argument of indicator, strategy and the plot functions (plot, hline, plotarrow, plotchar, plotshape). Shows values as prices, with as many decimals as the instrument’s price scale.
Type
const string
Example
format.volume (constant)
Definition
A format for script values, for the format argument of indicator, strategy and the plot functions (plot, hline, plotarrow, plotchar, plotshape). Shows values as volume, abbreviating large numbers (for example 5.2K or 1.3M).
Type
const string
Example