IndicatorDigits

Sets the number of decimal places for indicator values.

Syntax

IndicatorDigits(digits: number): void

Parameters

  • digits - A number representing the number of decimal digits to display for indicator values.

Return Value

This method does not return a value.

Description

The IndicatorDigits method sets the number of decimal places that will be used when displaying indicator values. This affects how values are formatted in tooltips, indicator configuration panels, and other UI elements.

Setting the appropriate number of decimal places is important for readability and precision. For example, oscillators that range between 0 and 100 might use 1 or 2 decimal places, while price-based indicators might need 4 or 5 decimal places for currency pairs.

Example

// Set indicator to display 2 decimal places
this.api.IndicatorDigits(2)

// For a price-based indicator on EURUSD (which typically has 5 decimal places)
this.api.IndicatorDigits(5)

// For an RSI indicator (values between 0-100)
this.api.IndicatorDigits(1)

Last updated