调整每分钟更新一次数据

This commit is contained in:
jackyu66git
2026-02-02 13:32:39 +08:00
parent 645f017fa0
commit 73eaf0f19a
+5 -4
View File
@@ -102,12 +102,13 @@ class ChanLun_EMA52(IStrategy):
(self.pair, "1w"),
]
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
self.init_dataframes(dataframe)
dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
last_price = dataframe.iloc[-1]['close']
tf_ema52_list = self.chan.check_price_ema52(last_price)
if self.last_time + timedelta(minutes=1) < datetime.now():
logger.info(tf_ema52_list)
logger.info("init_dataframes----------------------------")
last_price = dataframe.iloc[-1]['close']
tf_ema52_list = self.chan.check_price_ema52(last_price)
self.init_dataframes(dataframe)
logger.info("Price_ema52_list: " + str(tf_ema52_list))
self.last_time = datetime.now()
return dataframe
def init_dataframes(self, dataframe_1m):