Your interactive trading laboratory!
 • 
8 users online

Problem with lookback periods and dynamic universe

I think this is a problem, please set me straight. When running a dynamic universe like Nasdaq 100, QS doesn't start calculating a given indicator until the bar that a given symbol shows up in the universe (despite the existence of price data from before the moment it becomes part of the universe). For some indicators, like a short period SMA, that would be fine. But for other indicators, it creates a problem.

Example: My published PMO GoGo is a rotation model, running weekly (both data and rebalancing). Symbol AMD has a long data history, but only joined the universe in June 2018. Using the dynamic universe, QS starts calculating PMO with data from June 2018, and the PMO(35,20) weekly calculations yield huge numbers (starting around 70 and dropping down to 25 by Mar 2019). The real values for PMO(35,20) weekly, that are calculated based on the longer data history and that I would LIKE to be using here, should start around 5 in June 2018, run up to 25 or so at the price peak in Sep, then back down to 12 or so today.

I've attached a screenshot showing this issue, one chart of AMD weekly from a model using all the data, and a smaller inset showing AMD with only the dynamic universe time period used, with PMO(35,20) graphed in both. I think this is a real issue, and think there should be a way to specify that you'd like to run a model using all the available historical price data for a symbol that enters the universe, rather than only using data from the time period that the stock was a part of the universe.


Attachment

Cancel

Responses

Oh, and in the bottom panel of the big graph is an example of the new QComposite indicators, CompInd, showing the average value of the PMO(35,20) indicator across the NASDAQ 100 through time. Thanks for the new extension, Glitch, although I did find it a bit tricky to get the syntax right; the doc example was a bit vague.

Oh, and in the bottom panel of the big graph is an example of the new QComposite indicators, CompInd, showing the average value of the PMO(35,20) indicator across the NASDAQ 100 through time. Thanks for the new extension, Glitch, although I did find it a bit tricky to get the syntax right; the doc example was a bit vague.

Hi bitfool, the QPremium provider loads 200 leads bars so indicators up to that period can be calculated. Do you think you need more lead bars for your purposes? I can extend this. I updated the QComposite document with an example of creating the indicator in code.

Hi bitfool, the QPremium provider loads 200 leads bars so indicators up to that period can be calculated. Do you think you need more lead bars for your purposes? I can extend this. I updated the QComposite document with an example of creating the indicator in code.

Not sure about needing more, although it seems odd that 200 lead bars didn't do the trick. I'll investigate further and let you know what I think/find.

Not sure about needing more, although it seems odd that 200 lead bars didn't do the trick. I'll investigate further and let you know what I think/find.

I looked more closely and it's actually 200 calendar days, not trading days. So that amounts to about 142 leads bars on a daily chart. This makes it worse in a weekly scale of course, giving us only 40 bars of data on the chart. I will work on changing this to 200 leads bars instead of calendar days! Here's an example of the effect on PMO weekly, chart on the left loading all data and the chart on the right loading from QPremium dynamic universe with lead bar data.

I looked more closely and it's actually 200 calendar days, not trading days. So that amounts to about 142 leads bars on a daily chart. This makes it worse in a weekly scale of course, giving us only 40 bars of data on the chart. I will work on changing this to 200 leads bars instead of calendar days! Here's an example of the effect on PMO weekly, chart on the left loading all data and the chart on the right loading from QPremium dynamic universe with lead bar data.

Thanks Glitch. Looks like if you use PMO and an example like AMD here and get the number of lead bars right for PMO(35,20) to work, then that should be good for just about anything else.

Thanks Glitch. Looks like if you use PMO and an example like AMD here and get the number of lead bars right for PMO(35,20) to work, then that should be good for just about anything else.
Forum Tips

Please sign in if you want to participate in our forum.

Our forum uses Markdown syntax to format posts.

To embed code snippets, enclose them in [CODE][/CODE] tags.