diff --git a/ChanSEG.py b/ChanSEG.py index ff775ed..86165ba 100644 --- a/ChanSEG.py +++ b/ChanSEG.py @@ -96,7 +96,10 @@ class ChanSEG(): if self.dir == Chan_SEG_DIR.UP: for index in range(1, len(self.bi_list)): bi = self.bi_list[index] + #print(bi.end_time, bi.next,"UP SEG BI ZS Index") if bi.next == None or bi.next.next == None: + if last_zs and (bi.low > last_zs.zg or bi.high < last_zs.zd): + last_zs.set_end_bi(last_zs.bi_list[-1], last_zs.bi_list[-1].sure_time) continue bi2 = bi.next bi3 = bi.next.next @@ -118,6 +121,7 @@ class ChanSEG(): else: if bi.index > last_zs.bi_list[-1].index and bi.dir == Chan_BI_DIR.DOWN and bi.is_sure: if bi.low > last_zs.zg or bi.high < last_zs.zd: + #print(bi.end_time, "UP SEG BI ZS End") last_zs.set_end_bi(last_zs.bi_list[-1], last_zs.bi_list[-1].sure_time) if bi3.is_sure and bi3.index <= self.bi_list[-1].index and bi.check_bi_zs_overlap() and bi.dir == Chan_BI_DIR.DOWN: zg = min(bi.high, bi2.high, bi3.high) @@ -137,12 +141,14 @@ class ChanSEG(): last_zs.add_bi(bi.pre) last_zs.add_bi(bi) if index == len(self.bi_list) - 1 and last_zs and not last_zs.is_sure: - #print(bi.start_time, "BI", last_zs.is_sure) + print(bi.start_time, "BI", last_zs.is_sure) last_zs.set_end_bi(last_zs.bi_list[-1], last_zs.bi_list[-1].sure_time) else: for index in range(1, len(self.bi_list)): bi = self.bi_list[index] if bi.next == None or bi.next.next == None: + if last_zs and (bi.low > last_zs.zg or bi.high < last_zs.zd): + last_zs.set_end_bi(last_zs.bi_list[-1], last_zs.bi_list[-1].sure_time) continue bi2 = bi.next bi3 = bi.next.next diff --git a/web/app.py b/web/app.py index c94ffff..c2a3c70 100644 --- a/web/app.py +++ b/web/app.py @@ -50,6 +50,8 @@ logger = logging.getLogger(__name__) DATA_SERVICE_URL = os.environ.get("DATA_SERVICE_URL", os.environ.get("DATASVC_URL", "http://127.0.0.1:9009")) #DATA_SERVICE_URL = os.environ.get("DATA_SERVICE_URL", os.environ.get("DATASVC_URL", "http://192.168.1.9:9009")) +#DATA_SERVICE_URL = os.environ.get("DATA_SERVICE_URL", os.environ.get("DATASVC_URL", "http://103.179.242.166")) + DEFAULT_TIMEFRAME_LABELS = OrderedDict([ ("1m", "1分钟"), ("3m", "3分钟"),