I have attached a bare bones strategy to demonstrate the issue. Note that the strategy is doing basically nothing in OnBarUpdate. It's only reporting the elapsed time on the final historical bar.
There are some boolean properties that can be selected in the UI, each will load a different type of secondary data series. After re-running the strategy, look at the elapsed time in the output console.
I have 5 years of YM 03-24 30min bars in a chart as my primary series.
Here are my results selecting each of the secondary data series options in turn (via the Strategy UI). The numbers below are typical values after refreshing and re-running the strategy multiple times.
| No secondary series | 40ms |
| Add Day Series | 60ms |
| Add 30 Minute Series | 40ms |
| Add 60 Minute Series | 506ms |
| Add 1440 Minute Series | 527ms |
| Add 30 Minute MYM Series | 2231ms |
| Add 30 Minute ES Series | 2127ms |
| Add 30 Minute CL Series | 4000+ms then 43ms |
Several points:
- These numbers show a 10x to 50x performance hit for certain scenarios.
- These times usually persist per iteration in the optimizer, massively slowing down optimizations.
- The behavior is NOT 100% consistent. In the CL 30min case above, it was multi-second times for several minutes of testing until suddenly it was super fast. Meanwhile, MYM 30min and ES 30min are still very slow. The super fast speed is what I would always expect because you can cache the bars. But it seems to be completely rebuilding bars every time and even re-downloading the data some of the time.
My Questions:
1. Why is there such a performance hit for some scenarios?
2. I've seen these types of flaky performance issues on data series for years on different computers, different NT versions, different installs. It's very frustrating. (That wasn't a question.)
3. Is there anything that can be done, or guidelines to follow, that will minimize or eliminate these types of problems.
4. Can you replicate the issue?
5. Is this expected behavior?
By the way, I have cleared the files in /NinjaTrader 8/db/cache

Comment