#ifndef __DataFormats_h_ #define __DataFormats_h_ #include #include #include #include #include "../../shared/MiscSupport.h" struct BarData { double open, high, low, close; time_t startTime; unsigned int volume, printCount; }; typedef std::vector< BarData > BarList; void dumpBarList(const BarList &bars); struct FundamentalData { std::string companyName, listedExchange; double dividend, earnings; double high52Week, low52Week; int putVolume, callVolume; int shortInterest; double peRatio, beta, marketCap; int sharesOutstanding; double epsNetIncome; int income, revenues, assets, debt; }; void dumpFundamentalData(const FundamentalData &fundamentalData); struct Split { // Data before this date was one way; data on or after the date is //the other way. time_t date; //Historical data from TAL, and also SpryWare has already been //adjusted for splits. If you want to see the original price, and //there is only one of these, and the price comes from before the //specified date, then you need to multiply by the split factor. //If there was more than one split, the most recent one will have //the lowest index. SplitFactor only shows the difference between //the price on the given date and the previous day. If you want to //see the original price, you will have to multiply it by all of //the split factors. double splitFactor; }; struct CorporateActions { std::vector< Split > splits; // This table has other useful stuff that we might want in the future. // In particular, it says when a stock is delisted. That might help // us when we sanatize the data. }; void dumpCorporateActions(const CorporateActions &corporateActions); #endif