Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
VladKochetov007 committed May 21, 2021
1 parent a26ca4a commit 0ce50ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
<img alt="Creative Commons License" style="border-width:0"
src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" />
Expand Down
11 changes: 7 additions & 4 deletions quick_trade/brokers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -60,18 +61,20 @@ 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)

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')
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import setuptools
from distutils.core import setup


with open('./README.md') as file:
long_desc = file.read()

Expand Down

0 comments on commit 0ce50ad

Please sign in to comment.