mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-09 10:35:54 +08:00
updated symbols.json for 3 exchanges: end_daily, end_minute
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user