diff --git a/core/biz/__pycache__/market_monitor.cpython-312.pyc b/core/biz/__pycache__/market_monitor.cpython-312.pyc index deb0430..c5808e2 100644 Binary files a/core/biz/__pycache__/market_monitor.cpython-312.pyc and b/core/biz/__pycache__/market_monitor.cpython-312.pyc differ diff --git a/core/biz/market_monitor.py b/core/biz/market_monitor.py index 106fcd5..608f724 100644 --- a/core/biz/market_monitor.py +++ b/core/biz/market_monitor.py @@ -262,13 +262,13 @@ def create_metrics_report( short_info_list = long_short_info["空"] contents.append(f"#### 多头指标信号") if len(long_info_list) > 0: - contents.append(f"{"\n".join(long_info_list)}") + contents.append(f"{"\n\n".join(long_info_list)}") else: contents.append(f"无多头指标信号") contents.append(f"#### 空头指标信号") if len(short_info_list) > 0: - contents.append(f"{"\n".join(short_info_list)}") + contents.append(f"{"\n\n".join(short_info_list)}") else: contents.append(f"无空头指标信号") diff --git a/market_monitor_main.py b/market_monitor_main.py index 2295aef..e160477 100644 --- a/market_monitor_main.py +++ b/market_monitor_main.py @@ -141,7 +141,7 @@ class MarketMonitorMain: ) return if only_output_rise: - if realtime_row["pct_change"] > 0: + if realtime_row["pct_chg"] > 0: logging.info(f"监控到上涨: {symbol} {bar} 窗口大小: {self.window_size}") else: logging.info( @@ -191,10 +191,14 @@ class MarketMonitorMain: report_data = pd.DataFrame([report_data]) logging.info(f"插入数据到数据库") self.db_market_monitor.insert_data_to_mysql(report_data) + if self.latest_record.get(symbol, None) is None: self.latest_record[symbol] = {bar: {"timestamp": latest_realtime_timestamp}} else: - self.latest_record[symbol][bar]["timestamp"] = latest_realtime_timestamp + if self.latest_record.get(symbol, {}).get(bar, None) is None: + self.latest_record[symbol][bar] = {"timestamp": latest_realtime_timestamp} + else: + self.latest_record[symbol][bar]["timestamp"] = latest_realtime_timestamp with open(self.latest_record_file_path, "w", encoding="utf-8") as f: json.dump(self.latest_record, f, ensure_ascii=False, indent=4) @@ -252,8 +256,8 @@ class MarketMonitorMain: if __name__ == "__main__": market_monitor_main = MarketMonitorMain() market_monitor_main.monitor_realtime_market( - symbol="ETH-USDT", - bar="5m", + symbol="PUMP-USDT", + bar="15m", only_output_huge_volume=True, - only_output_rise=False, + only_output_rise=True, ) diff --git a/sql/query/sql_playground.sql b/sql/query/sql_playground.sql index d07bb41..e9fb023 100644 --- a/sql/query/sql_playground.sql +++ b/sql/query/sql_playground.sql @@ -1,7 +1,7 @@ select * from crypto_market_monitor; -delete from crypto_market_monitor where timestamp=1754382900000; + select date_time, open, high, low, close, k_shape from crypto_market_data -WHERE symbol='XCH-USDT' and bar='5m' and date_time > '2025-08-04 15:00:00' +WHERE symbol='DOGE-USDT' and bar='5m' and date_time > '2025-08-04 15:00:00' order by timestamp ; select * from crypto_market_data