Print Page  
Advanced Functions / Relative vs. History
FHistRel("formula", samples [, weeks_increment=1, NA_value=NA, NA_Pct=20])
Full Description

These functions compare the most recent value vs. historical values using and calculate a relative statistic. They can be used, for example, to find stocks that are trading at lower valuations than historically. These "FHist" relative functions return a statistic from a series of weekly historical values evaluated at different observation dates. For more information about how historical Point In Time (PIT) values are evaluated, see the FHist() function.

FHistZScore("formula", samples[, weeks_increment, clip, NA_value, NA_pct])
Calculates the Z-Score of the latest value vs. all the values.

FHistRank("formula", samples[, weeks_increment, sort, sort_style, NA_value, NA_pct])
Calculates the percentile rank of the latest value vs. all the values.

FHistRel("formula", samples[, weeks_increment, sort, NA_value, NA_pct])
Calculates the relative value vs. the minimum and the maximum of the samples. The range of values is from 0 to 1.

Parameters

formula: the expression you want evaluated in the past
samples: how many times formula is evaluated
weeks_increment: how many weeks between samples (1-52, default 1)
clip: z-score clip. Defaults to 3.5 which clips to either -3.5 or +3.5
sort: how the values are sorted. Can be either #ASC or #DESC (default)
sort_style: how the ranks are distributed. Can be either #Top (default) or #Neutral
NA_value: value for NAs. Defaults to NA
NA_pct: the max percentage of values that can be NA (0-80, default 20)

Relative FHist Examples

Screen for stocks that are trading at the highest 90% Price to Sales for the past year.

FHistRank("Pr2SalesTTM", 26, 2) > 90

The Pr2SalesTTM is sampled 26 times over the past year, with data collected every two weeks, corresponding to a 1-year period.