16 const std::string
path=
"/home/michael/www/www.my_portfolio_test.org/data";
19 int main(
int argc,
char* argv[]) {
21 std::string symbol,tmp_str_time;
27 cout <<
"Error need 2 arguments: symbol timescale" << endl;
31 symbol.assign(argv[1]);
36 tmp_str_time.assign(argv[2]);
40 cout <<
"Error need 2 arguments: symbol timescale" << endl;
45 if ( (tmp_timescale=atoi(argv[2])) != 0 )
46 timescale = (TimeScale) tmp_timescale;
50 if ( tmp_str_time ==
"DAY" ) {timescale=
DAY;}
51 else if ( tmp_str_time ==
"WEEK" ) timescale=
WEEK;
52 else if ( tmp_str_time ==
"MONTH" ) timescale=
MONTH;
53 else if ( tmp_str_time ==
"H1" ) timescale=
H1;
54 else if ( tmp_str_time ==
"M30" ) timescale=
M30;
55 else if ( tmp_str_time ==
"TRIM" ) timescale=
TRIM;
56 else if ( tmp_str_time ==
"M10" ) timescale=
M10;
57 else if ( tmp_str_time ==
"YEAR" ) timescale=
YEAR;
58 else if ( tmp_str_time ==
"M5" ) timescale=
M5;
59 else { cout <<
"argument2 " << tmp_str_time <<
" Not known, exit" << endl;
return 1;}
75 cout <<
"Stock " << symbol <<
"Timescale " << timescale << endl;
Define the class Stock to deal with an unique stock: DJ, IBM...
Main class to deal with one stock.
int Transform_TimeScale(const ETime &new_tmscl)
Transform history values dcsv or DAY to M5,M10..H1 or WEEK, MONTH..YEAR.
void WriteCSV(const ETime tmscl, bool opt_tmp=false) const
Write historical data into files.