init
This commit is contained in:
@@ -11,7 +11,13 @@ class MonitorCoin (Monitor):
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self) -> None:
|
||||
tmps = self.getBalances()
|
||||
balances = {}
|
||||
for tmp in tmps:
|
||||
balances[tmp['currency']] = {'balance': float(tmp['balance']), 'avg_buy_price': float(tmp['avg_buy_price'])}
|
||||
|
||||
for symbol in KR_COINS_1:
|
||||
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
@@ -21,7 +27,7 @@ class MonitorCoin (Monitor):
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
continue
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
sell_success = self.sell_ticker_1h(symbol, recent_inverseData, balances)
|
||||
if not sell_success:
|
||||
continue
|
||||
|
||||
@@ -29,7 +35,7 @@ class MonitorCoin (Monitor):
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
continue
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
buy_success = self.buy_ticker_1h(symbol, recent_data)
|
||||
if not buy_success:
|
||||
continue
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user