This commit is contained in:
Nullart2
2018-08-05 21:08:07 +08:00
parent 4a9bf78770
commit 26d591ea43
3 changed files with 6 additions and 5 deletions

View File

@@ -116,7 +116,7 @@ class Exchange(object):
api.urls['api'] = api.urls['test']
logger.info("Enabled Sandbox API on %s", name)
else:
logger.warning(self, "No Sandbox URL in CCXT, exiting. "
logger.warning(name, "No Sandbox URL in CCXT, exiting. "
"Please check your config.json")
raise OperationalException(f'Exchange {name} does not provide a sandbox api')

View File

@@ -34,7 +34,7 @@ def parse_ticker_dataframe(ticker: list) -> DataFrame:
return frame
def order_book_to_dataframe(data: list) -> DataFrame:
def order_book_to_dataframe(bids: list, asks: list) -> DataFrame:
"""
Gets order book list, returns dataframe with below format per suggested by creslin
-------------------------------------------------------------------
@@ -42,11 +42,12 @@ def order_book_to_dataframe(data: list) -> DataFrame:
-------------------------------------------------------------------
"""
cols = ['bids', 'b_size']
bids_frame = DataFrame(data['bids'], columns=cols)
bids_frame = DataFrame(bids, columns=cols)
# add cumulative sum column
bids_frame['b_sum'] = bids_frame['b_size'].cumsum()
cols2 = ['asks', 'a_size']
asks_frame = DataFrame(data['asks'], columns=cols2)
asks_frame = DataFrame(asks, columns=cols2)
# add cumulative sum column
asks_frame['a_sum'] = asks_frame['a_size'].cumsum()