diff --git a/monitor.py b/monitor.py index 5803fb6..197c72b 100644 --- a/monitor.py +++ b/monitor.py @@ -131,8 +131,46 @@ class Monitor: ) return normalized_data + def inverse_data(self, data: pd.DataFrame) -> pd.DataFrame: + """원본 data 가격 시계를 상하 대칭(글로벌 min/max 기준)으로 반전하여 하락↔상승 트렌드를 뒤집는다.""" + price_cols = ['Open', 'High', 'Low', 'Close'] + inv = data.copy() + global_min = data[price_cols].min().min() + global_max = data[price_cols].max().max() + # 축 기준은 global_mid = (max+min), so transformed = max+min - price + for col in price_cols: + inv[col] = global_max + global_min - data[col] + # Volume은 그대로 유지 + inv['Volume'] = data['Volume'] + # 지표 다시 계산 + inv = self.normalize_data(inv) + + inv['MA5'] = inv['Close'].rolling(window=5).mean() + inv['MA20'] = inv['Close'].rolling(window=20).mean() + inv['MA40'] = inv['Close'].rolling(window=40).mean() + inv['MA120'] = inv['Close'].rolling(window=120).mean() + inv['MA200'] = inv['Close'].rolling(window=200).mean() + inv['MA240'] = inv['Close'].rolling(window=240).mean() + inv['MA720'] = inv['Close'].rolling(window=720).mean() + inv['MA1440'] = inv['Close'].rolling(window=1440).mean() + inv['Deviation5'] = (inv['Close'] / inv['MA5']) * 100 + inv['Deviation20'] = (inv['Close'] / inv['MA20']) * 100 + inv['Deviation40'] = (inv['Close'] / inv['MA40']) * 100 + inv['Deviation120'] = (inv['Close'] / inv['MA120']) * 100 + inv['Deviation200'] = (inv['Close'] / inv['MA200']) * 100 + inv['Deviation240'] = (inv['Close'] / inv['MA240']) * 100 + inv['Deviation720'] = (inv['Close'] / inv['MA720']) * 100 + inv['Deviation1440'] = (inv['Close'] / inv['MA1440']) * 100 + inv['golden_cross'] = (inv['MA5'] > inv['MA20']) & (inv['MA5'].shift(1) <= inv['MA20'].shift(1)) + inv['MA'] = inv['Close'].rolling(window=20).mean() + inv['STD'] = inv['Close'].rolling(window=20).std() + inv['Upper'] = inv['MA'] + (2 * inv['STD']) + inv['Lower'] = inv['MA'] - (2 * inv['STD']) + return inv + def calculate_technical_indicators(self, data: pd.DataFrame) -> pd.DataFrame: data = self.normalize_data(data) + data['MA5'] = data['Close'].rolling(window=5).mean() data['MA20'] = data['Close'].rolling(window=20).mean() data['MA40'] = data['Close'].rolling(window=40).mean() @@ -154,6 +192,7 @@ class Monitor: data['STD'] = data['Close'].rolling(window=20).std() data['Upper'] = data['MA'] + (2 * data['STD']) data['Lower'] = data['MA'] - (2 * data['STD']) + return data # ------------- Strategy ------------- diff --git a/monitor_coin.py b/monitor_coin.py index ff550b9..9a03344 100644 --- a/monitor_coin.py +++ b/monitor_coin.py @@ -17,16 +17,22 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_point'].iloc[-1] != 1: + continue + sell_success = self.sell_ticker(symbol, recent_inverseData) + if not sell_success: + continue + data = self.calculate_technical_indicators(data) recent_data = self.check_buy_point(symbol, data) + if recent_data['buy_point'].iloc[-1] != 1: continue buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: continue - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - continue except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") diff --git a/monitor_coin_1.py b/monitor_coin_1.py index e159e8c..786aa72 100644 --- a/monitor_coin_1.py +++ b/monitor_coin_1.py @@ -17,6 +17,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_point'].iloc[-1] != 1: + continue + sell_success = self.sell_ticker(symbol, recent_inverseData) + if not sell_success: + continue + data = self.calculate_technical_indicators(data) recent_data = self.check_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -24,9 +32,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: continue - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - continue except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_2.py b/monitor_coin_2.py index 82b69ff..42d08b2 100644 --- a/monitor_coin_2.py +++ b/monitor_coin_2.py @@ -17,6 +17,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_point'].iloc[-1] != 1: + continue + sell_success = self.sell_ticker(symbol, recent_inverseData) + if not sell_success: + continue + data = self.calculate_technical_indicators(data) recent_data = self.check_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -24,9 +32,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: continue - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - continue except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_ADA.py b/monitor_coin_ADA.py index cd803ff..b6c1075 100644 --- a/monitor_coin_ADA.py +++ b/monitor_coin_ADA.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_APE.py b/monitor_coin_APE.py index 59f9165..530d25c 100644 --- a/monitor_coin_APE.py +++ b/monitor_coin_APE.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_ARB.py b/monitor_coin_ARB.py index b15af92..7bdfd5c 100644 --- a/monitor_coin_ARB.py +++ b/monitor_coin_ARB.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_BONK.py b/monitor_coin_BONK.py index d056172..6eec0dc 100644 --- a/monitor_coin_BONK.py +++ b/monitor_coin_BONK.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_ENA.py b/monitor_coin_ENA.py index 69a65c8..b6429d7 100644 --- a/monitor_coin_ENA.py +++ b/monitor_coin_ENA.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_HBAR.py b/monitor_coin_HBAR.py index ff1c823..d51d316 100644 --- a/monitor_coin_HBAR.py +++ b/monitor_coin_HBAR.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_KAIA.py b/monitor_coin_KAIA.py index 3fcb448..6669757 100644 --- a/monitor_coin_KAIA.py +++ b/monitor_coin_KAIA.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_LINK.py b/monitor_coin_LINK.py index aca7540..8ecbe30 100644 --- a/monitor_coin_LINK.py +++ b/monitor_coin_LINK.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_ONDO.py b/monitor_coin_ONDO.py index e8f823a..497e4c7 100644 --- a/monitor_coin_ONDO.py +++ b/monitor_coin_ONDO.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_PENGU.py b/monitor_coin_PENGU.py index 1e0b320..1bc581f 100644 --- a/monitor_coin_PENGU.py +++ b/monitor_coin_PENGU.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_PEPE.py b/monitor_coin_PEPE.py index 22754be..34e04e5 100644 --- a/monitor_coin_PEPE.py +++ b/monitor_coin_PEPE.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_POL.py b/monitor_coin_POL.py index 6b373af..35c4190 100644 --- a/monitor_coin_POL.py +++ b/monitor_coin_POL.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_SAND.py b/monitor_coin_SAND.py index 4128cbc..530e344 100644 --- a/monitor_coin_SAND.py +++ b/monitor_coin_SAND.py @@ -22,6 +22,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -29,9 +37,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_SEI.py b/monitor_coin_SEI.py index 4ab921f..5d4a410 100644 --- a/monitor_coin_SEI.py +++ b/monitor_coin_SEI.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_SHIB.py b/monitor_coin_SHIB.py index e5f636f..8dcb040 100644 --- a/monitor_coin_SHIB.py +++ b/monitor_coin_SHIB.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_STORJ.py b/monitor_coin_STORJ.py index 1791d10..31ca026 100644 --- a/monitor_coin_STORJ.py +++ b/monitor_coin_STORJ.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_SUI.py b/monitor_coin_SUI.py index 4a8b659..dd36a43 100644 --- a/monitor_coin_SUI.py +++ b/monitor_coin_SUI.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_TON.py b/monitor_coin_TON.py index 7333066..f4819de 100644 --- a/monitor_coin_TON.py +++ b/monitor_coin_TON.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_TRX.py b/monitor_coin_TRX.py index 9a26d02..ec94bd5 100644 --- a/monitor_coin_TRX.py +++ b/monitor_coin_TRX.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_UXLINK.py b/monitor_coin_UXLINK.py index cd00310..a4e534d 100644 --- a/monitor_coin_UXLINK.py +++ b/monitor_coin_UXLINK.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_VIRTUAL.py b/monitor_coin_VIRTUAL.py index 240d576..d1b013c 100644 --- a/monitor_coin_VIRTUAL.py +++ b/monitor_coin_VIRTUAL.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_WLD.py b/monitor_coin_WLD.py index 94f66ba..672b7b4 100644 --- a/monitor_coin_WLD.py +++ b/monitor_coin_WLD.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_XLM.py b/monitor_coin_XLM.py index ad1467f..ebaba3c 100644 --- a/monitor_coin_XLM.py +++ b/monitor_coin_XLM.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: diff --git a/monitor_coin_XRP.py b/monitor_coin_XRP.py index dce78c9..cb009d8 100644 --- a/monitor_coin_XRP.py +++ b/monitor_coin_XRP.py @@ -16,6 +16,14 @@ class MonitorCoin (Monitor): 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_buy_point(symbol, inverseData) + if recent_inverseData['sell_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_buy_point(symbol, data) if recent_data['buy_point'].iloc[-1] != 1: @@ -23,9 +31,6 @@ class MonitorCoin (Monitor): buy_success = self.buy_ticker(symbol, recent_data) if not buy_success: return - sell_success = self.sell_ticker(symbol, recent_data) - if not sell_success: - return except Exception as e: print(f"Error processing data for {symbol}: {str(e)}") else: