Various Q&A about portfolio backtest
Author: bullorbear
Creation Date: 12/3/2010 10:00 AM
profile picture

bullorbear

#1
I tried to use wealthlab to back test intraday strategies, but repeatedly ran into problems.

I used 6 mo 1-min bars with nasdaq 100 stocks, using a very simple correlation b/w each of the stock and the nasdaq-100 index (QQQQ specifically). I tried both update date of the 100 stock (plus QQQQ) first, as well as use on-demand download, but I have the following problems / questions:

1. I prepared the data by updating 1-min data of the 100 stocks first, and checked that all data were downloaded (except occationally somehow data was not available for certain symbols). I then tested the strategy on individual stocks, and it workeds (you can see trades being generated on the charts and in strategy resports). However, if I ran the exact same strategy with the exact same parameters on portfolio of the 100 stocks, wealthlab lab somehow kept telling me data of certain symbols were not available - even it was there when I tested on a given symbol by itself. Also, at the end of "collecting data" phase, wealthlab came back telling me the data for the benchmark was not there - even it was there and generate trades when I tested the strategy on the index itself.

2. updating data somehow pull-in all 4-5 years of 1-min data even if I only requested 6 months of 1-min data, and it took long time to download. I called Fidelity, they told me that I have no way of controlling the length of download. It that ture? Suspecting that it could be due to memory overflow, and after told by Fidelity that by testing the strategy with on-demand data download, I may have a chance to make it work, I tried on-demand data download as well. However, after repeated trials with on-demand data download, I still have the same problem.

3. I am thinking of using wealthlab to test and trade portfolio of stocks, but really having a hard time to make it work. Not sure if it is due to machine power problem, or due to the construct of wealthlab. If it's the problem of machine memory / processing speed, what it takes in order for me to test say 1000 stocks of 6 month 1-min bar. Likewise, what it takes in term of machine memory and processing speed so that I can trade the strategy live over 1000 stocks using 1-min bar? (assume the strategy uses OHLC / volume of the past 200 1-min bars). How do I estimate the required system if I have to use longer history in trading signals?

4. Can wealthlab support after hour and pre-market data? currently, the function is not there through Fidelity. Also, can wealthlab handel tick-by-tich data instead of current min of 1-min?
profile picture

Cone

#2
1. Possibly a low-memory issue. Assuming you're on a 32-bit system, you're pushing the limits of the number of bars in a simulation. The "rule of thumb" for 2G (the max an app can address in 32-bit) is 100 symbols, 10 months of 1-minute data. It's only a rule of thumb, so depending on other conditions, the limit could be more or less.

2. The idea is that you download data only once. Then, it's updated from there when requested. Just make sure that you don't specify "All Data" in the Data Loading control. Use "Last 6 Months", for example.

The minor disadvantage of working with a larger local data file plus the benefits of having all the data readily available, far outweighs the disadvantage of the time required to download all the data, which can be done while you sleep.

3. The answer depends on the type of trading that you're actually doing. But, if you plan on using the Strategy Monitor with 1000, 1-Min symbols and Fidelity data, it's just not going to work because of the way Fidelity updates that tool. (See User Guide)

4. Sure Wealth-Lab supports after hour and pre-market data if the data provider supports it. (It's not a "Wealth-Lab" dependency, rather it's a provider issue.) Sure, tick-by-tick too (you'll need a provider that supports it), but if you're trading a heavily-traded issue, you may need to buy a separate machine for each instrument traded.
profile picture

Eugene

#3
Welcome to the forums.

1. Don't take the error message word for word. Let's have a look at the code, your DataSet, and your data loading settings to reproduce the error.

2. Right but not "somehow" but intentionally i.e. by (good) design. Fidelity static provider tries to load all available historical data for a symbol. It's best to turn on demand data update off and update your DataSets before backtesting.

3. Using a formula in this FAQ: FAQ | Strategies and WealthScript, it's very easy to compute memory requirements.

Required RAM = 1000 * (1440 min * 22 = 31680) * 6 * 8 = 1.5 Gigabytes

It won't be possible to realistically work with such amount of data on a 32-bit Windows due to memory fragmentation and other limitations. You'll need a 64-bit PC with at least 4 Gb RA (the more the better as it's dirt cheap these days) with 64-bit Windows and WLP6 64-bit edition.

If the strategy actually loads just 200 1-min bars (as specified in the Data Loading Range dialog) then just a little fraction of memory would be required.

4. Our FAQ says "no" to pre/after-market Fidelity data: FAQ | Data and Data Providers, but other providers may not have this limitation as pointed above by Cone.

Wealth-Lab can handle tick data if you have a 3rd party source of tick-based data. Fidelity doesn't provide it, and probably this isn't planned.

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).