Merge branch 'develop' of github.com:enigmampc/catalyst into develop

This commit is contained in:
Victor Grau Serrat
2017-10-24 21:55:25 -06:00
3 changed files with 15 additions and 6 deletions
+1
View File
@@ -556,6 +556,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
except Exception as e:
log.warn('unable to calculate performance: {}'.format(e))
# TODO: pickle does not seem to work in python 3
try:
save_algo_object(
algo_name=self.algo_namespace,
+4 -4
View File
@@ -1,7 +1,7 @@
import json
import os
import pickle
from six.moves.urllib.request import urlretrieve
from six.moves.urllib import request
from datetime import date, datetime
import pandas as pd
@@ -33,7 +33,7 @@ def get_exchange_symbols_filename(exchange_name, environ=None):
def download_exchange_symbols(exchange_name, environ=None):
filename = get_exchange_symbols_filename(exchange_name)
url = SYMBOLS_URL.format(exchange=exchange_name)
response = urlretrieve(url=url, filename=filename)
response = request.urlretrieve(url=url, filename=filename)
return response
@@ -154,8 +154,8 @@ def save_algo_df(algo_name, key, df, environ=None, rel_path=None):
filename = os.path.join(folder, key + '.csv')
with open(filename, 'wb') as handle:
df.to_csv(handle)
with open(filename, 'wt') as handle:
df.to_csv(handle, encoding='UTF_8')
def get_exchange_minute_writer_root(exchange_name, environ=None):
+10 -2
View File
@@ -92,12 +92,20 @@ class Poloniex_api(object):
post_data.encode('utf-8'),
hashlib.sha512).hexdigest()
headers = {'Sign': signature, 'Key': self.key}
post_data = post_data.encode('utf-8')
else:
raise ValueError(
'Method "' + method + '" not found in neither the Public API or Trading API endpoints')
'Method "' + method + '" not found in neither the Public API '
'or Trading API endpoints'
)
self.ask_request()
req = urllib.request.Request(url, data=post_data, headers=headers)
req = urllib.request.Request(
url,
data=post_data,
headers=headers
)
return json.loads(urlopen(req).read())
def returnticker(self):