10 year median on FRED time series

All,

I’m looking to obtain and use a rule based around the 10 year median for different FRED series. From what I can tell, the closest thing is SMA or EMA, but this is limited to 500 bars, or 2 years when measured daily.

I’m particularly looking at daily values, so this would be 2,600 bars.

Any help to find the 10 year median, or a workaround?

Thanks in advance,
Ryan

FRED series are usually weekly, monthly, quarterly, or annual, and rarely daily. So, for example, LoopMedian(“Close(CTR,##HDEBTSERV)”,40) will give you the ten-year median since ##HDEBTSERV is reported quarterly. If you look at the Factor and Function Reference under Time Series IDs, the description under each item will tell you how often it reports.

Yuval, I’m looking at the high yield spread, ##CORPBBBOAS, reported daily. Unfortunately Loopmedian is limited to 502 bars.

Can you change the frequency of the series to land within the max # of allowable bars?

Yes, sure.

LoopMedian (“Close (Ctr, ##CORPBBBOAS)”, 502, 0, 5)

Now you’ll get the median of the BBB series over the last ten years but using only every 5th bar.

That did it, thanks Yuval.