ProScreener/proscreener

PERCENTFORMAT

PERCENTFORMAT is a ProScreener display modifier that renders a numeric value as a percentage in SCREENER results columns, multiplying the value by 100.

Syntax

probuilder
SCREENER(value AS "Column name" PERCENTFORMAT)

How it works

Ratios and performance measures are usually computed as decimal fractions, where 0.05 means five percent. Placing PERCENTFORMAT after the AS "Column name" clause tells the results table to multiply the value by 100, round to two decimals, and append a percent sign, so the fraction reads naturally in the results.

The scaling is fixed. Whatever number reaches the column is multiplied by 100, which is why the reference example, feeding in the raw value 20221202, displays as 2,022,120,200.00%. The modifier does not detect whether a value is already expressed in percent, so the expression feeding the column must be a plain fraction.

Like the other display modifiers, PERCENTFORMAT changes presentation only. Sorting and filtering still operate on the underlying numeric value, and exactly one of DATEFORMAT, NUMBERFORMAT, PERCENTFORMAT, or STRINGFORMAT can be applied per column.

Examples

Example 1, Fixed value showing the scaling behavior (ProScreener)

probuilder
// Any numeric value is multiplied by 100 and shown with a percent sign
number = 20221202
SCREENER(number AS "Formatted Percentage" PERCENTFORMAT)

The column displays 2,022,120,200.00%, which demonstrates that the modifier always multiplies by 100. This is the canonical example from the official reference.

Example 2, 20-bar performance as a percentage (ProScreener)

probuilder
// Performance over 20 bars, computed as a decimal fraction
perf = close / close[20] - 1
SCREENER[perf > 0.05](perf AS "Perf 20 bars" PERCENTFORMAT)

Instruments up more than five percent over 20 bars are listed, and the fraction 0.0523 displays as 5.23% in the results column.

Example 3, Overnight gap column (ProScreener)

probuilder
// Gap between today's open and the previous close, as a fraction
gap = (open - close[1]) / close[1]
SCREENER[ABS(gap) > 0.02](gap AS "Gap" PERCENTFORMAT)

Instruments gapping more than two percent in either direction are returned, with the gap size rendered as a signed percentage.

Common errors and gotchas

  • Double scaling. Feeding the column a value already expressed in percent multiplies it by 100 again, so 5 displays as 500.00%. Indicators such as Variation and ROC already return percentages, so either divide them by 100 before the column or omit the modifier.
  • Fixed two-decimal rounding. The display rounds to two decimal places. Small fractions such as 0.0001 show as 0.01%, and finer distinctions are invisible in the column even though sorting still uses the exact value.
  • One format modifier per column. PERCENTFORMAT cannot be combined with DATEFORMAT, NUMBERFORMAT, or STRINGFORMAT on the same column. Pick the single modifier that matches the data.
  • ProScreener only. The keyword compiles nowhere else. Percentage display in indicators is achieved by scaling the returned value, not with screener modifiers.
  • DATEFORMAT, renders a YYYYMMDD number as a readable date in a screener column.
  • NUMBERFORMAT, abbreviates large numeric values in a screener column.
  • STRINGFORMAT, shows a screener column value exactly as stored.
  • SCREENER, defines the filter condition and result column of a screener.
  • Variation, percentage change of the current bar, already scaled by 100.
  • ROC, rate of change indicator, already expressed in percent.
  • TIMEFRAME (PS), sets the timeframe used by subsequent screener code.