添加动能理论chanmacd,顶底分型5隐形形态

This commit is contained in:
jackyu66git
2025-08-19 16:35:56 +08:00
parent b15ba06a00
commit 29e98d6eed
8 changed files with 128 additions and 24 deletions
+6 -8
View File
@@ -1,7 +1,7 @@
import copy
from typing import Dict, Optional
from ChanEnum import Chan_FX_TYPE, Chan_KLINE_DIR, Chan_BI_DIR, Chan_KLC_FX, Chan_K_DIR
from ChanEnum import Chan_FX_TYPE, Chan_KLINE_DIR, Chan_BI_DIR, Chan_KLC_FX, Chan_K_DIR, Chan_MACD_STATE
import ChanKLU
import ChanCTime
@@ -78,17 +78,15 @@ class ChanKLC():
self.klc_fx_type = Chan_KLC_FX.BOTTOM4
if self.fx == Chan_FX_TYPE.TOP:
#print(self.end_time, self.fx, self.macd, self.macdhist, len(self.klus))
if self.macd > 0:
self.bb_out = True
if self.macdhist < 0:
if self.macdhist < 0 and self.macd > 0 and self.macd > self.pre.macd and self.macd > self.next.macd:
self.klc_fx_type = Chan_KLC_FX.TOP5
self.bb_out = True
else:
if self.fx == Chan_FX_TYPE.BOTTOM:
if self.macd < 0:
self.bb_out = True
if self.macdhist > 0:
if self.macdhist > 0 and self.macd < 0 and self.macd < self.pre.macd and self.macd < self.next.macd:
self.klc_fx_type = Chan_KLC_FX.BOTTOM5
#self.bb_out = True
self.bb_out = True
def cal_macd_state(self, dir):
macd_state = 0
return macd_state