def download_handler_func(d): # This handler downloads the secutity if (d["src"] == "Google"): TD = gdl.download_TD_google(d["symbolID"], period=d["period"], timeInterval="15d") # Create the information for the next handler from the previous info d["TD"] = TD print TD.iloc[[0, -1]]
def set_TD_from_google(self, symbolID=None, period=None, timeInterval="30d"): symbolID, period = self.get_final_SymbolID_period(symbolID, period) TD = gdl.download_TD_google(symbolID, period, timeInterval) self.set_TD(TD) return TD
# Download the data from website maybe: TD2 = gdl.get_data_yahoo2(symbol="AAPL", precision="m", start_date="01-12-2011", end_date="01-12-2015") TD_yahoo = gdl.download_D1_TD_yahoo("AAPL", sdate, edate) TD_yahoo2 = gdl.download_D1_TD_yahoo_prev("AAPL", sdate, edate) TD_yahoo3 = gdl.download_TD_yahoo(symbol="AAPL", precision="m", start_date=dt.datetime(2016, 1, 1), end_date=dt.datetime(2017, 1, 1)) TD_google = gdl.download_TD_google("AAPL", period_seconds=60 * 1440 * 7, timeInterval="15d") TD_google = gdl.download_D1_TD_google("AAPL", sdate, edate) timeData.set_TD(TD_google) timeData.set_TD_from_google("ONT", 5, "10d") #####################################################################3 timeData.set_interval(sdate, edate) opentime, closetime = timeData.guess_openMarketTime() period = timeData.guess_period() print "Period: %f" % period print "Market Hours " + str(opentime) + " - " + str(closetime) dataTransform = ["intraday", opentime, closetime] #dataTransform = None dataHLOC = timeData.get_timeSeries(["High", "Low", "Open", "Close"])
def set_TD_from_google(self, symbolID = None, period = None, timeInterval = "30d"): symbolID, period = self.get_final_SymbolID_period(symbolID, period) TD = gdl.download_TD_google(symbolID, period, timeInterval) self.set_TD(TD) return TD