Saving Custom Calculated Series for a symbol
Author: ivraju
Creation Date: 4/29/2013 10:22 PM
profile picture

ivraju

#1
Hi

I created a data series with custom calculated values for a symbol, I want to save that series so that next time when I open strategy I don't have to calculate entire series for that symbol again, just load from saved file and only custom calculate for new bars. Can I do that in Wealth-Lab.

Thanks
Raju
profile picture

Eugene

#2
I guess that you're asking because your calculation (or your PC) is so slow that you expect to gain noticeable performance increase from caching on disk? If so, I really suggest you start by optimizing the DataSeries, speeding up its implementation instead of inventing complex workarounds.

Again, this is the correct way but if you're willing to do some DIY programming, here's a flow chart for you!



Notes:

FillSeriesFromFile is a helper method from Community Components: FillSeriesFromFile

*Note that many a DataSeries (take SMA, for example) have one or more lookback period(s). Consequently, to calculate for new bars only still requires to pre-load a required number of bars from the past.

**Also, to calculate for new bars you should be using the .Value method of your DataSeries (or its analogue): you can't use the .Series method for that purpose.

EDIT: Noticed when it was already too late: "Has loop ended?", if the answer is "No", should have a redirection to "1. Calculate..." (but that's obvious)
profile picture

ivraju

#3
Thank you.

I have good computer but the reason I asked for this is that I do use SetContext and process several symbols when I run my strategy.
Now when I run the strategy I believe its going to calculate data series from scratch each time I run the strategy for those symbols that I am calculating using SetContext. When I call RestoreContext, I think it clears the buffer for symbol that has been used with SetContext and only keeps the Cache for the main symbol that started the strategy. What I am trying to do is trying to keep the cache for those symbols called using SetContext method as well. With out going to ascii files or database, can I keep the cache for those symbols using SetContext method? or is my understanding incorrect using SetContext method?

Thanks
Raju
profile picture

Eugene

#4
QUOTE:
or is my understanding incorrect using SetContext method?


You'll find the answer in the QuickRef > ClearExternalSymbols.
profile picture

ivraju

#5
Thank you my doubt has been cleared.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).