I was having all kinds of issues with my scripts throwing errors, so I wrote this little script to check for out of sequence dates. If you run it against a Data Set, it prints a list of the symbols with bad bars in the Debug window. If you run it against a single symbol, it will also highlight the bad bar on the Chart.
I was amazed how many of my symbols had out of sequence dates. In most cases, the problem was an extra bar that had been inserted. This can easily be fixed by right clicking on the bar and clicking Edit Bar Data>Remove.
It is a good idea to rerun the script after you fix the bar to make sure there aren't multiple problems with the data. (Don't forget to manually clear the Debug window before you rerun it.)
CODE:
Please log in to see this code.
Size:
Color:
Also, check out the "Bad History Data Check" strategy in Utilities folder.
Size:
Color:
After analyzing the errors more carefully and comparing my data to my backed up data, many of the out of sequence bars are NOT extra bars, but are bars which once were in the correct order, but which are now out of sequence. I don't have any way of knowing how this happened, but I would caution everyone to back up their Wealth-Lab data often, just like you would any other data. That way, you won't have to manually fix the data if it become corrupted!
Size:
Color: