def candle_input_web(self, currency_pair, start, end, period): poloniex_session = poloniex(poloniex_API_key, poloniex_API_secret) candle_json = poloniex_session.returnChartData(currency_pair, start, end, period) candle_length = len(candle_json[u'candleStick']) self.volume = nan_array_initialise(candle_length) self.date = nan_array_initialise(candle_length) self.close = nan_array_initialise(candle_length) self.open = nan_array_initialise(candle_length) self.high = nan_array_initialise(candle_length) self.low = nan_array_initialise(candle_length) for loop_counter in range(candle_length): self.volume[loop_counter] = float( candle_json[u'candleStick'][loop_counter][u'volume']) self.date[loop_counter] = float( candle_json[u'candleStick'][loop_counter][u'date']) self.close[loop_counter] = float( candle_json[u'candleStick'][loop_counter][u'close']) self.open[loop_counter] = float( candle_json[u'candleStick'][loop_counter][u'open']) self.high[loop_counter] = float( candle_json[u'candleStick'][loop_counter][u'high']) self.low[loop_counter] = float( candle_json[u'candleStick'][loop_counter][u'low'])
def start_poloniex_session(self): """ Initiate poloniex session """ self.poloniex_session = poloniex(poloniex_API_key, poloniex_API_secret)