I tried implementing the IndexHelper
as described in the Wiki to backtest on dynamic (evolving) watch lists. I get the following error for every symbol.
"Error processing symbol TRN String was not recognized as a valid DateTime."
I have created a data set that contains all of the symbols that appear in the time dated watch lists. I use this as the data set for the back test.
Then I have all of the individual watch lists in the C:\Data directory. The format of the file names of the individual watch lists is "IBD50_YYYYMMDD.txt"
Each watch list contains the symbols for the time period specified. Only one symbol is listed per line.
The code I have written is below. When I change the code to work with a static data set, it works just fine. Do you have any ideas why the strategy won't work with the dynamic watch lists?
Thanks
CODE:
Please log in to see this code.
Size:
Color:
At the moment, the message sounds pretty self-descriptive: for (at least) one of your time dated files, the date string in the file name could not be parsed:
QUOTE:
"Error processing symbol TRN String was not recognized as a valid DateTime."
Size:
Color:
Do you have any hints as to what I can do to get the date string to be parsed?
I have followed all of the instructions in the wiki page entitled
"Backtesting with Dynamic (Evolving) WatchLists". For example, my file names are: IBD50_20110610.txt, IBD50_20110617.txt, IBD50_20110624.txt, etc. just as instructed in the wiki page. Each file only has one symbol per line. As you can see from the code, "IBD50" is listed as the "index" in the IndexHelper function. I have attached a couple of the files.
I also tried to run the sample code found on the wiki page. I changed the name of the index to IBD50. It will not run either. It never prints the symbol name to the degug window. It just gives the error message for every single symbol in the data set.
thanks
Size:
Color:
Once again: review the names of
all of your TXT files. One (or more) of them does not follow the YYYYMMDD pattern correctly. To be on the safe side, make sure the folder does not contain
any other files. I have double checked that your enclosed files work OK with the Wiki example code, producing the debug output as intended.
P.S. As this might lead to unxpected results...
CODE:
Please log in to see this code.
...it's better changed to:
CODE:
Please log in to see this code.
Size:
Color:
Thanks for the help. I will check each file. Is it a problem if the date for the file is a non-trading day, i.e. holiday or weekend?
Also, thanks for the suggestion on setting the priority.
Size:
Color:
QUOTE:
Is it a problem if the date for the file is a non-trading day, i.e. holiday or weekend?
No.
Size:
Color: