EMA calculations in custom series chart - does the result vary depending on the period displayed?

Hi P123,

I noticed that EMA value seems to differ when adding an EMA overlay to a (weekly) custom series chart and comparing the value for a given date between a very long timeframe (e.g. 10 years) and a shorter one (e.g. 1 year). There seem to be a 5-day (1 week?) lag between between the 2 values.
The custom series is started from 1999 so the long term past values are available either way.

  • Could it be that the length of time displayed does impact the “seeding” of the EMA overlay?
  • or could it be that a weekly custom series somehow creates an anomaly?

The EMA values computed via getseries seemed to be matching the “long term display” ones as far as I could tell. This is reassuring as getseries is what to use in sims and live ports.

Key for me is to check that the values computed via getseries are correct (i.e. seeded correctly if the custom series is long enough)?

Many thanks,

Jerome

Can you send me examples? I’m not quite sure what you’re looking at here. It reads like there’s a one-week lag in long-term custom series charts, but I’m not sure that’s what your’e observing.

Hi Paul,

I think it might have something to do with the underlying way the raw data is displayed and made available for calculation of the EMA.

I created a simple public custom series here → https://www.portfolio123.com/app/series/summary/8277?st=0&mt=8
{use PR3K universe and one simple rule UnivMedian(“true”,“beta5y”)}

Run the chart on a weekly raw values with start date way back e.g. 1/1/2005

Now look at the raw data on the chart

  1. Select 1Y as timeframe.
  • Dec 16 2017 = 1.09
  • Dec 23 2017 = 0.98
  1. Select 5Y as timeframe: we no longer find Dec 16 or Dec 23 as available dates but we have
  • Dec 11 2017 = 1.09
  • Dec 18 2017 = 0.98

It looks like the 1Y display has a one week lag for raw values which -if this is the data passed on to the EMA calculation- could explain why it also gets a one week lag.

But the question is then: what is the correct value of the median Beta5Y for the PR3000 on Monday Dec 18th 2017?
1.09 (1Y timeframe) or 0.98 (5Y timeframe)?

Thanks,

Jerome

Jerome, you should use the download option to check the actual data we’re reporting.
[color=darkblue][font=courier new]Date Value EMA:30

12/16/2017 1.090605378 1.106984645
12/23/2017 0.978649974 1.0990292[/font][/color]
It looks like the charting tool is simply applying weekly grouping on values at that zoom level.
I’ll see if I can disable that option in the configuration for this chart.

OK - thank you Aaron

JMH

…and to summarize for my own sake when I eyeball charts:
at the moment, when using weekly or longer raw data, the longer timeframes (e.g. 5Y) are displayed slightly “incorrectly” while the 1Y display reflects accurately the data that we can download.

As you are at it, it might also be worth checking (and correcting if possible) if that display glitch affects other data display on long timeframes. Most importantly, I suspect that anything that is plotted daily (i.e. sims, ports, books) is displayed accurately whatever the timeframe chosen to visualize.

Thank you!

We plan to get the fix in next week. Thanks for helping us improve the platform.