Package QSTK :: Package csvconverter :: Module csvapi :: Class StockPriceData
[hide private]
[frames] | no frames]

Class StockPriceData

source code

Instance Methods [hide private]
 
__init__(self) source code
 
getSymbols(self, listOfPaths, fileExtensionToRemove) source code
 
getData(self, listOfListOfStocks, listOfInputPaths, startDate, endDate, listOfOutputPaths)
This is where all the work happens
source code
 
makeOrUpdateTimestampsFile(self, fileName, listOflistOfStocks, listOfInputPaths, startDate, endDate) source code
 
continueChecking(self, tsList, beginTS, endTS)
This function basically checks if a day that we haven't found any trades on is a weekend. If so- we don't need to keep looking. The converter will work just fine even without this function- but it will take more time- because it will keep looking for timestamps that it is not going to find.
source code
 
readTimestampsFromFile(self, fileName, beginTS, endTS) source code
 
keepHDFFilesInSyncWithCSV(self, listOfInputPaths, listOfOutputPaths)
This function removes HDF files that correspond to CSV files that existed in the past- but don't exist anymore. Possibly because the stock was delisted or something like that.
source code
Method Details [hide private]

getSymbols(self, listOfPaths, fileExtensionToRemove)

source code 

Bug: This might not work if the path contains a folder whose name has .csv, or is some random file that has a .csv in it.. So, lets assume that whoever is using this is not going to "cheat" us

getData(self, listOfListOfStocks, listOfInputPaths, startDate, endDate, listOfOutputPaths)

source code 

Attention: Assumption here is that past data never changes

Bug: The exchange is currently set pretty randomly

makeOrUpdateTimestampsFile(self, fileName, listOflistOfStocks, listOfInputPaths, startDate, endDate)

source code 

Bug: Formerly did not take care of DST

Attention: fixed DST bug. No known DST problems now.

continueChecking(self, tsList, beginTS, endTS)

source code 

Bug: There is a Daylight savings time bug here too- but it won't adversely affect anything because DST always happens over the weekends! Though if the time change happens on a weekday sometime in the distant past/future this function may break.