Regional PE Valuation¶
© 2026 Jim Domeij
This calculates 10-year P/E valuation statistics (average, standard deviation, minimum and maximum) for major equity regions. Current levels are compared to these statistics to assess the relative expansiveness vs history and other regions.
The BQL query builds a shared 10-year date range, defines a reusable forward P/E series, and computes #avg, #std, #min, #max, plus the latest value #last for each index in the universe. BQL returns a Polars DataFrame with ID and those five fields, which are renamed for plotting.
The chart visualizes each region’s distribution using a box for average ±1 standard deviation, whiskers for min/max, a diamond for the average, and a triangle for the latest value.
Out[1]:
In [2]:
Copied!
# Get P/E for different regions
from polars_bloomberg import BQuery
query = """
let(
#series=headline_pe_ratio(dates=range(-10Y, 0D, frq=D));
#avg=avg(#series);
#std=std(#series);
#min=min(#series);
#max=max(#series);
#last=headline_pe_ratio();
)
for([
'SPX Index',
'B500XM7T Index',
'SXXP Index',
'TPX Index',
'UKX Index',
'MXEF Index',
'SHSZ300 Index'
])
get(#avg, #std, #min, #max, #last)
with(fpt=BT, fpo=1)
preferences(dropCols=['REVISION_DATE', 'AS_OF_DATE', 'PERIOD_END_DATE'])
"""
with BQuery() as bq:
df = bq.bql(query).combine()
df.head()
# Get P/E for different regions
from polars_bloomberg import BQuery
query = """
let(
#series=headline_pe_ratio(dates=range(-10Y, 0D, frq=D));
#avg=avg(#series);
#std=std(#series);
#min=min(#series);
#max=max(#series);
#last=headline_pe_ratio();
)
for([
'SPX Index',
'B500XM7T Index',
'SXXP Index',
'TPX Index',
'UKX Index',
'MXEF Index',
'SHSZ300 Index'
])
get(#avg, #std, #min, #max, #last)
with(fpt=BT, fpo=1)
preferences(dropCols=['REVISION_DATE', 'AS_OF_DATE', 'PERIOD_END_DATE'])
"""
with BQuery() as bq:
df = bq.bql(query).combine()
df.head()
Out[2]:
shape: (5, 6)
| ID | #avg | #std | #min | #max | #last |
|---|---|---|---|---|---|
| str | f64 | f64 | f64 | f64 | f64 |
| "SPX Index" | 18.854204 | 2.229219 | 13.563658 | 23.339709 | 22.050241 |
| "B500XM7T Index" | 17.725393 | 1.807348 | 12.613702 | 21.704093 | 19.95632 |
| "SXXP Index" | 14.464378 | 1.579359 | 10.638401 | 18.889421 | 15.256618 |
| "TPX Index" | 14.718192 | 1.778616 | 11.116715 | 20.47531 | 16.522521 |
| "UKX Index" | 12.791636 | 1.702829 | 8.702596 | 17.191449 | 13.389673 |