diff --git a/LICENSE.md b/LICENSE.md index 6f6ad39f..5f04ea6d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,3 @@ - Creative Commons License diff --git a/quick_trade/brokers.py b/quick_trade/brokers.py index ae6edfdc..eb7295a6 100644 --- a/quick_trade/brokers.py +++ b/quick_trade/brokers.py @@ -11,6 +11,7 @@ class TradingClient(object): quantity: float ticker: str order: Dict[str, typing.Any] + def __init__(self, client: ccxt.Exchange): self.client = client @@ -60,8 +61,8 @@ def get_data_historical(self, limit: int = 1000): frames = self.client.fetch_ohlcv(ticker, - interval, - limit=limit) + interval, + limit=limit) data = pd.DataFrame(frames, columns=['time', 'Open', 'High', 'Low', 'Close', 'Volume']) return data.astype(float) @@ -69,9 +70,11 @@ def get_data_historical(self, def exit_last_order(self): if self.ordered: if self.__side__ == 'Sell': - self.new_order_buy(self.ticker, self.get_balance_ticker(self.ticker.split('/')[0]), logging=False) # buy for all balance + self.new_order_buy(self.ticker, self.get_balance_ticker(self.ticker.split('/')[0]), + logging=False) # buy for all balance elif self.__side__ == 'Buy': - self.new_order_sell(self.ticker, self.get_balance_ticker(self.ticker.split('/')[1]), logging=False) # sell all + self.new_order_sell(self.ticker, self.get_balance_ticker(self.ticker.split('/')[1]), + logging=False) # sell all self.__side__ = 'Exit' self.ordered = False utils.logger.info('client exit') diff --git a/setup.py b/setup.py index bb10e3ba..141b3d3a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ import setuptools from distutils.core import setup - with open('./README.md') as file: long_desc = file.read()