This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_data_hardread(self, ts_list, symbol_list, data_item, verbose=False, bIncDelist=False): | |
''' | |
Read data into a DataFrame no matter what. | |
@param ts_list: List of timestamps for which the data values are needed. Timestamps must be sorted. | |
@param symbol_list: The list of symbols for which the data values are needed | |
@param data_item: The data_item needed. Like open, close, volume etc. May be a list, in which case a list of DataFrame is returned. | |
@param bIncDelist: If true, delisted securities will be included. | |
@note: If a symbol is not found then a message is printed. All the values in the column for that stock will be NaN. Execution then | |
continues as usual. No errors are raised at the moment. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn select-value | |
"Given a dataset indexed by date, returns the value corresponding to a specified column | |
if existent for a specific date" | |
[ds column date] | |
(let [row (ds {:Date date})] | |
(when-not (nil? row) (incanter.core/$ 0 column row)))) | |
(defn get-data | |
"Given a list of `symbols`, its data and a list of specific `timestamps`, builds a matrix(sequence) | |
with each column corresponding to a stock and the value extracted using `column` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
(c) 2011, 2012 Georgia Tech Research Corporation | |
This source code is released under the New BSD license. Please see | |
http://wiki.quantsoftware.org/index.php?title=QSTK_License | |
for license details. | |
Created on September, 12, 2011 | |
@author: Tucker Balch | |
@contact: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-NYSE-days | |
"Create a set of timestamps between startday and endday | |
that correspond to the days there was trading at the NYSE" | |
[start-date end-date time-of-day] | |
(let [dates-file (str *QS* "/qstkutil/NYSE_dates.txt") | |
NYSE-dates (incanter.io/read-dataset dates-file) | |
fmt (formatter "MM/dd/yyyy") | |
dates (incanter.core/$map #(parse fmt %) :col0 NYSE-dates)] | |
(set (filter (fn [d] (within? (interval start-date end-date) d)) | |
(map #(plus % time-of-day) dates))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#When presented with failure | |
igb-3.4.8/src/igb_main.c:193: error: implicit declaration of function SET_RUNTIME_PM_OPS | |
#Add the following macro to | |
#/usr/src/linux-headers-2.6.32-5-common/include/linux/pm.h | |
#ifdef CONFIG_PM_RUNTIME | |
#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | |
.runtime_suspend = suspend_fn, \ | |
.runtime_resume = resume_fn, \ |
NewerOlder