添加动能理论chanmacd,顶底分型5隐形形态
This commit is contained in:
+15
-5
@@ -14,7 +14,9 @@ class ChanMACDSeg():
|
||||
self.seg_dir = seg_dir
|
||||
self.pre = pre_seg
|
||||
self.next = None
|
||||
self.peak_klu = start_klu
|
||||
self.high_klu = start_klu
|
||||
self.low_klu = start_klu
|
||||
self.ref_klu = None
|
||||
def set_next(self, next_seg):
|
||||
self.next = next_seg
|
||||
def add_klu(self, klu):
|
||||
@@ -22,11 +24,19 @@ class ChanMACDSeg():
|
||||
self.klu_list.append(klu)
|
||||
klu.set_seg(self)
|
||||
if self.seg_dir == Chan_MACDSEG_DIR.ABOVE:
|
||||
if klu.high > self.peak_klu.high:
|
||||
self.peak_klu = klu
|
||||
if klu.macdhist > self.high_klu.macdhist:
|
||||
self.high_klu = klu
|
||||
else:
|
||||
if klu.macdhist < self.low_klu.macdhist:
|
||||
self.low_klu = klu
|
||||
else:
|
||||
if klu.low < self.peak_klu.low:
|
||||
self.peak_klu = klu
|
||||
if klu.macdhist < self.high_klu.macdhist:
|
||||
self.high_klu = klu
|
||||
else:
|
||||
if klu.macdhist > self.low_klu.macdhist:
|
||||
self.low_klu = klu
|
||||
if self.high_klu.index != self.start_klu.index:
|
||||
self.ref_klu = self.high_klu
|
||||
def add_unittf(self, unittf):
|
||||
self.unittf_list.append(unittf)
|
||||
unittf.set_next(self)
|
||||
|
||||
Reference in New Issue
Block a user