This shows you the differences between two versions of the page.
haas:fall2017:datacomm:projects:pds0 [2017/08/21 17:30] – created wedge | haas:fall2017:datacomm:projects:pds0 [2017/08/21 17:42] (current) – [Program] wedge | ||
---|---|---|---|
Line 62: | Line 62: | ||
In the example above, the header would be the first 7 lines: | In the example above, the header would be the first 7 lines: | ||
- | <cli> | + | <code> |
EXCHANGE%3DOTCMKTS | EXCHANGE%3DOTCMKTS | ||
MARKET_OPEN_MINUTE=570 | MARKET_OPEN_MINUTE=570 | ||
Line 70: | Line 70: | ||
DATA= | DATA= | ||
TIMEZONE_OFFSET=-240 | TIMEZONE_OFFSET=-240 | ||
- | </cli> | + | </code> |
What this is basically telling us is which stock exchange this data pertains to (somewhat unimportant for our current project), the absolute minute from the start of the day when the markets opened and closed (potentially important for what we are doing), the interval of data being reported (in units of seconds), the overall format of the data (date, close, high, etc.), a seemingly unused (maybe reserved?) DATA option, and finally a timezone offset (what timezone is this data being reported in?) | What this is basically telling us is which stock exchange this data pertains to (somewhat unimportant for our current project), the absolute minute from the start of the day when the markets opened and closed (potentially important for what we are doing), the interval of data being reported (in units of seconds), the overall format of the data (date, close, high, etc.), a seemingly unused (maybe reserved?) DATA option, and finally a timezone offset (what timezone is this data being reported in?) | ||
Line 76: | Line 76: | ||
Following the header we have a stanza pertaining to a day, which will kick off with a line like this: | Following the header we have a stanza pertaining to a day, which will kick off with a line like this: | ||
- | <cli> | + | <code> |
+ | a1500903000, | ||
+ | </code> | ||
- | </cli> | + | This is effectively kicking off item 0 in the reported interval. |
+ | |||
+ | That first field (note a comma-separated list), is actually an encoded UNIX time value, which we'll want to decode to report more recognizable date information (YYYY-MM-DD HH:MM). | ||
+ | |||
+ | The successive fields correspond, in order with the values laid out in the **COLUMNS** option in the header (after DATE comes the prior CLOSE, then the HIGH, the LOW, the OPEN, and finally the VOLUME). | ||
+ | |||
+ | With the exception of DATE and VOLUME, everything else is represented as a decimal cost (you may assume dollars). | ||
+ | |||
+ | Subsequent lines in the stanza are merely offset intervals from the first, for instance: | ||
+ | |||
+ | < | ||
+ | 1, | ||
+ | 2, | ||
+ | 3, | ||
+ | 4, | ||
+ | </code> | ||
+ | |||
+ | No UNIX time value to decode, merely an offset to add to that initial UNIX time value. | ||
+ | |||
+ | Your job is to write a program that, when provided one of these dataset files as a command-line argument, will open and read its contents into memory (I'm leaving the // | ||
+ | |||
+ | * in a specified time interval (minute, 10 minute, 30 minute, hour, day, 2 days, 5 days). | ||
+ | * the CLOSE, HIGH, LOW, OPEN, or VOLUME at the specified time interval | ||
+ | |||
+ | Results for now should just be displayed to STDOUT. | ||
+ | |||
+ | Clearly, there' | ||
+ | |||
+ | Submission is via the lab46 submit tool, by the posted deadline, for the source code (able to compile and run without issue on lab46). |