updated symbols.json for 3 exchanges: end_daily, end_minute

This commit is contained in:
Victor Grau Serrat
2017-10-06 21:03:31 -06:00
parent 14f8c25c89
commit a1cf00e6fe
3 changed files with 49 additions and 7 deletions
+14 -2
View File
@@ -585,9 +585,21 @@ class Bitfinex(Exchange):
except KeyError as e:
start_date = time.strftime('%Y-%m-%d')
try:
end_daily = cached_symbols[symbol]['end_daily']
except KeyError as e:
end_daily ='N/A'
try:
end_minute = cached_symbols[symbol]['end_minute']
except KeyError as e:
end_minute = 'N/A'
symbol_map[symbol]= dict(
symbol = symbol[:-3]+'_'+symbol[-3:],
start_date = start_date
symbol = symbol[:-3]+'_'+symbol[-3:],
start_date = start_date,
end_daily = end_daily,
end_minute = end_minute,
)
if(filename is None):
+21 -3
View File
@@ -12,8 +12,8 @@ from catalyst.exchange.exchange_errors import InvalidHistoryFrequencyError, \
CreateOrderError
from catalyst.finance.execution import LimitOrder, StopLimitOrder
from catalyst.finance.order import Order, ORDER_STATUS
from catalyst.exchange.exchange_utils import get_exchange_symbols_filename
from catalyst.exchange.exchange_utils import get_exchange_symbols_filename, \
download_exchange_symbols
log = Logger('Bittrex')
@@ -309,6 +309,11 @@ class Bittrex(Exchange):
def generate_symbols_json(self, filename=None):
symbol_map = {}
fn, r = download_exchange_symbols(self.name)
with open(fn) as data_file:
cached_symbols = json.load(data_file)
markets = self.api.getmarkets()
for market in markets:
exchange_symbol = market['MarketName']
@@ -316,9 +321,22 @@ class Bittrex(Exchange):
market=self.sanitize_curency_symbol(market['MarketCurrency']),
base=self.sanitize_curency_symbol(market['BaseCurrency'])
)
try:
end_daily = cached_symbols[exchange_symbol]['end_daily']
except KeyError as e:
end_daily ='N/A'
try:
end_minute = cached_symbols[exchange_symbol]['end_minute']
except KeyError as e:
end_minute = 'N/A'
symbol_map[exchange_symbol] = dict(
symbol=symbol,
start_date=pd.to_datetime(market['Created'], utc=True).strftime("%Y-%m-%d")
start_date=pd.to_datetime(market['Created'], utc=True).strftime("%Y-%m-%d"),
end_daily = end_daily,
end_minute = end_minute,
)
if(filename is None):
+14 -2
View File
@@ -487,9 +487,21 @@ class Poloniex(Exchange):
except KeyError as e:
start_date = time.strftime('%Y-%m-%d')
try:
end_daily = cached_symbols[exchange_symbol]['end_daily']
except KeyError as e:
end_daily ='N/A'
try:
end_minute = cached_symbols[exchange_symbol]['end_minute']
except KeyError as e:
end_minute = 'N/A'
symbol_map[exchange_symbol] = dict(
symbol = symbol,
start_date = start_date
symbol = symbol,
start_date = start_date,
end_daily = end_daily,
end_minute = end_minute,
)
if(filename is None):