fix issue
This commit is contained in:
parent
b2f227cdf4
commit
5f5633f4b6
Binary file not shown.
|
|
@ -262,13 +262,13 @@ def create_metrics_report(
|
||||||
short_info_list = long_short_info["空"]
|
short_info_list = long_short_info["空"]
|
||||||
contents.append(f"#### 多头指标信号")
|
contents.append(f"#### 多头指标信号")
|
||||||
if len(long_info_list) > 0:
|
if len(long_info_list) > 0:
|
||||||
contents.append(f"{"\n".join(long_info_list)}")
|
contents.append(f"{"\n\n".join(long_info_list)}")
|
||||||
else:
|
else:
|
||||||
contents.append(f"无多头指标信号")
|
contents.append(f"无多头指标信号")
|
||||||
|
|
||||||
contents.append(f"#### 空头指标信号")
|
contents.append(f"#### 空头指标信号")
|
||||||
if len(short_info_list) > 0:
|
if len(short_info_list) > 0:
|
||||||
contents.append(f"{"\n".join(short_info_list)}")
|
contents.append(f"{"\n\n".join(short_info_list)}")
|
||||||
else:
|
else:
|
||||||
contents.append(f"无空头指标信号")
|
contents.append(f"无空头指标信号")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ class MarketMonitorMain:
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
if only_output_rise:
|
if only_output_rise:
|
||||||
if realtime_row["pct_change"] > 0:
|
if realtime_row["pct_chg"] > 0:
|
||||||
logging.info(f"监控到上涨: {symbol} {bar} 窗口大小: {self.window_size}")
|
logging.info(f"监控到上涨: {symbol} {bar} 窗口大小: {self.window_size}")
|
||||||
else:
|
else:
|
||||||
logging.info(
|
logging.info(
|
||||||
|
|
@ -191,8 +191,12 @@ class MarketMonitorMain:
|
||||||
report_data = pd.DataFrame([report_data])
|
report_data = pd.DataFrame([report_data])
|
||||||
logging.info(f"插入数据到数据库")
|
logging.info(f"插入数据到数据库")
|
||||||
self.db_market_monitor.insert_data_to_mysql(report_data)
|
self.db_market_monitor.insert_data_to_mysql(report_data)
|
||||||
|
|
||||||
if self.latest_record.get(symbol, None) is None:
|
if self.latest_record.get(symbol, None) is None:
|
||||||
self.latest_record[symbol] = {bar: {"timestamp": latest_realtime_timestamp}}
|
self.latest_record[symbol] = {bar: {"timestamp": latest_realtime_timestamp}}
|
||||||
|
else:
|
||||||
|
if self.latest_record.get(symbol, {}).get(bar, None) is None:
|
||||||
|
self.latest_record[symbol][bar] = {"timestamp": latest_realtime_timestamp}
|
||||||
else:
|
else:
|
||||||
self.latest_record[symbol][bar]["timestamp"] = latest_realtime_timestamp
|
self.latest_record[symbol][bar]["timestamp"] = latest_realtime_timestamp
|
||||||
with open(self.latest_record_file_path, "w", encoding="utf-8") as f:
|
with open(self.latest_record_file_path, "w", encoding="utf-8") as f:
|
||||||
|
|
@ -252,8 +256,8 @@ class MarketMonitorMain:
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
market_monitor_main = MarketMonitorMain()
|
market_monitor_main = MarketMonitorMain()
|
||||||
market_monitor_main.monitor_realtime_market(
|
market_monitor_main.monitor_realtime_market(
|
||||||
symbol="ETH-USDT",
|
symbol="PUMP-USDT",
|
||||||
bar="5m",
|
bar="15m",
|
||||||
only_output_huge_volume=True,
|
only_output_huge_volume=True,
|
||||||
only_output_rise=False,
|
only_output_rise=True,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
select * from crypto_market_monitor;
|
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
|
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 ;
|
order by timestamp ;
|
||||||
|
|
||||||
select * from crypto_market_data
|
select * from crypto_market_data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue