添加一些显示数据

This commit is contained in:
jackyu66git
2026-02-02 13:51:21 +08:00
parent 73eaf0f19a
commit 82e4ee5b64
2 changed files with 7 additions and 6 deletions
+4 -4
View File
@@ -47,17 +47,17 @@ class TF_DF():
self.zs_list = self.get_zs_list(self.bi_list, self.seg_list)
self.chanmacd = ChanMACD(self.klu_list)
self.klu_list = self.chanmacd.cal_macd_state()
def get_ema52(self):
def get_ema52(self, index=-1):
if self.klu_list:
ema52_value = self.klu_list[-1].ema52
ema52_value = self.klu_list[index].ema52
# 处理NaN值
if pd.isna(ema52_value) or ema52_value is None:
return None
return float(ema52_value)
return None
def get_ema24(self):
def get_ema24(self, index=-1):
if self.klu_list:
ema24_value = self.klu_list[-1].ema24
ema24_value = self.klu_list[index].ema24
# 处理NaN值
if pd.isna(ema24_value) or ema24_value is None:
return None