diff --git a/core/biz/market_data.py b/core/biz/market_data.py index 08a2555..dd1c6de 100644 --- a/core/biz/market_data.py +++ b/core/biz/market_data.py @@ -64,7 +64,7 @@ class MarketData: candles_pd = candles_pd[['symbol', 'bar', 'timestamp', 'date_time', 'open', 'high', 'low', 'close', 'volume', 'volCcy', 'volCCyQuote', 'create_time']] candles_pd.sort_values('timestamp', inplace=True) candles_pd.reset_index(drop=True, inplace=True) - + return candles_pd else: logging.warning(f"未获取到{symbol}, {bar} 最新数据,请稍后再试") @@ -237,7 +237,7 @@ class MarketData: count += 1 if count > 3: break - time.sleep(10) + time.sleep(5) return response def get_data_from_db(self, symbol, bar, db_url): diff --git a/core/biz/market_monitor.py b/core/biz/market_monitor.py index 8ebaace..dea0a1f 100644 --- a/core/biz/market_monitor.py +++ b/core/biz/market_monitor.py @@ -285,6 +285,7 @@ def get_long_short_over_buy_sell( result = {} symbol = row["symbol"] bar = row["bar"] + date_time = row["date_time"] ma_long_short = str(row["ma_long_short"]) macd_signal = str(row["macd_signal"]) macd_divergence = str(row["macd_divergence"]) @@ -294,7 +295,7 @@ def get_long_short_over_buy_sell( boll_signal = str(row["boll_signal"]) boll_pattern = str(row["boll_pattern"]) contents = [] - contents.append(f"### {symbol} {bar} 对比形态") + contents.append(f"### {symbol} {bar} 对比形态 {date_time}") if ma_long_short in ["多", "空"]: contents.append(f"均线形态: {ma_long_short}") else: