init
This commit is contained in:
@@ -2,7 +2,7 @@ from datetime import datetime
|
||||
import time
|
||||
from config import *
|
||||
|
||||
from monitor import Monitor
|
||||
from monitor_1h import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
@@ -2,7 +2,7 @@ from datetime import datetime
|
||||
import time
|
||||
from config import *
|
||||
|
||||
from monitor import Monitor
|
||||
from monitor_1h import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
@@ -2,7 +2,7 @@ from datetime import datetime
|
||||
import time
|
||||
from config import *
|
||||
|
||||
from monitor import Monitor
|
||||
from monitor_1h import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'ADA'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'APE'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'ARB'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'BONK'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'ENA'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'HBAR'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'KAIA'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'LINK'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'ONDO'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'PENGU'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'PEPE'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'POL'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,59 +0,0 @@
|
||||
import pandas as pd
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from datetime import datetime
|
||||
import sqlite3
|
||||
import time
|
||||
import requests
|
||||
import json
|
||||
from config import *
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'SAND'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'SEI'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'SHIB'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'STORJ'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'SUI'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'TON'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'TRX'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'UXLINK'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'VIRTUAL'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'WLD'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'XLM'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -1,53 +0,0 @@
|
||||
from datetime import datetime
|
||||
import time
|
||||
|
||||
from monitor import Monitor
|
||||
|
||||
class MonitorCoin (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
def __init__(self, cooldown_file: str = 'coins_buy_time.json') -> None:
|
||||
super().__init__(cooldown_file)
|
||||
|
||||
def monitor_coins(self, symbol) -> None:
|
||||
print("[{}] {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), symbol))
|
||||
|
||||
interval = 60
|
||||
data = self.get_coin_some_data(symbol, interval)
|
||||
if data is not None and not data.empty:
|
||||
try:
|
||||
inverseData = self.inverse_data(data)
|
||||
recent_inverseData = self.check_point(symbol, inverseData)
|
||||
if recent_inverseData['point'].iloc[-1] != 1:
|
||||
return
|
||||
sell_success = self.sell_ticker(symbol, recent_inverseData)
|
||||
if not sell_success:
|
||||
return
|
||||
|
||||
data = self.calculate_technical_indicators(data)
|
||||
recent_data = self.check_point(symbol, data)
|
||||
if recent_data['point'].iloc[-1] != 1:
|
||||
return
|
||||
buy_success = self.buy_ticker(symbol, recent_data)
|
||||
if not buy_success:
|
||||
return
|
||||
except Exception as e:
|
||||
print(f"Error processing data for {symbol}: {str(e)}")
|
||||
else:
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
return
|
||||
# ------------- Scheduler -------------
|
||||
def run_schedule(self, ticker) -> None:
|
||||
|
||||
while True:
|
||||
self.monitor_coins(symbol)
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = 'XRP'
|
||||
cooldown_file = './resources/coins_buy_'+symbol+'.json'
|
||||
|
||||
MonitorCoin(cooldown_file).run_schedule(symbol)
|
||||
@@ -47,7 +47,7 @@ if __name__ == "__main__":
|
||||
|
||||
# 모니터링할 스크립트 목록
|
||||
scripts = [
|
||||
r"C:\workspace\AssetMonitor\monitor_coin_1.py",
|
||||
r"C:\workspace\AssetMonitor\monitor_coin_2.py"
|
||||
r"C:\workspace\AssetMonitor\monitor_coin_1h_1.py",
|
||||
r"C:\workspace\AssetMonitor\monitor_coin_1h_2.py"
|
||||
]
|
||||
monitor.monitor(scripts, interval=60)
|
||||
@@ -5,7 +5,7 @@ import schedule
|
||||
from config import *
|
||||
import FinanceDataReader as fdr
|
||||
|
||||
from monitor import Monitor
|
||||
from monitor_1h import Monitor
|
||||
|
||||
class MonitorStock (Monitor):
|
||||
"""자산(코인/주식/ETF) 모니터링 및 매수 실행 클래스"""
|
||||
|
||||
@@ -9,7 +9,7 @@ plt.rcParams['font.family'] ='AppleGothic'
|
||||
plt.rcParams['axes.unicode_minus'] =False
|
||||
|
||||
from config import *
|
||||
from monitor import Monitor
|
||||
from monitor_1h import Monitor
|
||||
|
||||
|
||||
class Simulation:
|
||||
Reference in New Issue
Block a user