From 81e91a0a0d8e153b4ec3d43419fac31e614786a3 Mon Sep 17 00:00:00 2001 From: Porter Date: Wed, 20 Aug 2025 10:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E4=BA=A4=E6=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 10244 -> 10244 bytes ChanKLC.py | 4 ++-- ChanLun.py | 4 ++++ ChanPY.py | 4 ++-- strategies/ChanLun_BTC_30.py | 6 +++--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.DS_Store b/.DS_Store index 13646e504aabbb8b6edd1fda4f46fd539b7d2d12..b4372df69626edc7135e62e185fc4b43027149b2 100644 GIT binary patch delta 102 zcmZn(XbG6$XEU^hRb=42j$iJMi0=CO&gF%&aY0&xjLDno8cadJ*letyp6{Suap gjGKQ-@Ud@f$YWyk^Yiam4k zlaq4tlNcBn1Q-|?yMeUce=q>DKw<>+CzTf$K=toVD#*z!E-^5;#>m9X!pg?Z!9H1D zEM7~xy4uj((m+SS$i%Q#N1@u#$i!Sn!O+0ethSbuLsVJcIw(FnCpRy@ck*&E`M5q} ztW7CS&PmG8&mqcp*} diff --git a/ChanKLC.py b/ChanKLC.py index 70c8553..4b402c0 100644 --- a/ChanKLC.py +++ b/ChanKLC.py @@ -78,12 +78,12 @@ 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.macdhist < 0 and self.macd > 0 and self.macd > self.pre.macd and self.macd > self.next.macd: + if self.macdhist < 5 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.macdhist > 0 and self.macd < 0 and self.macd < self.pre.macd and self.macd < self.next.macd: + if self.macdhist > -5 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 diff --git a/ChanLun.py b/ChanLun.py index 9f0437b..ce3191e 100644 --- a/ChanLun.py +++ b/ChanLun.py @@ -96,10 +96,14 @@ class ChanLun(): klc_index += 1 if klc.klc_fx_type == Chan_KLC_FX.TOP4: state_list.append("10") + elif klc.klc_fx_type == Chan_KLC_FX.TOP5: + state_list.append("20") #print(klc.start_time, klc.end_time, klc.klc_fx_type) elif klc.klc_fx_type == Chan_KLC_FX.BOTTOM4: state_list.append("-10") #print(klc.start_time, klc.end_time, klc.klc_fx_type) + elif klc.klc_fx_type == Chan_KLC_FX.BOTTOM5: + state_list.append("-20") else: state_list.append("00") else: diff --git a/ChanPY.py b/ChanPY.py index 0096f3c..b1727ab 100644 --- a/ChanPY.py +++ b/ChanPY.py @@ -1,7 +1,7 @@ import sys import os -#sys.path.append(os.path.abspath("/Users/jack/Documents/GitHub/chan.py")) -sys.path.append(os.path.abspath("/Users/jack/Project/chan.py")) +sys.path.append(os.path.abspath("/Users/jack/Documents/GitHub/chan.py")) +#sys.path.append(os.path.abspath("/Users/jack/Project/chan.py")) from Chan import CChan from BuySellPoint.BS_Point import CBS_Point from ChanConfig import CChanConfig diff --git a/strategies/ChanLun_BTC_30.py b/strategies/ChanLun_BTC_30.py index ff3612d..0fef294 100644 --- a/strategies/ChanLun_BTC_30.py +++ b/strategies/ChanLun_BTC_30.py @@ -83,7 +83,7 @@ class ChanLun_BTC_30(IStrategy): time30 = 30 time60 = 60 time4h = 240 - time30 = 60 + time30 = 15 last_time = datetime.now() chan = ChanLun() chanpy = ChanPY() @@ -321,7 +321,7 @@ class ChanLun_BTC_30(IStrategy): shift_time = self.time30 dataframe.loc[ ( - (dataframe[state_str].shift(shift_time) == "-10") + (dataframe[state_str].shift(shift_time) == "-20") #(dataframe['state'] == "-30") #(dataframe[state_str].shift(shift_time) == "-10") #(dataframe[fx_str].shift(shift_time) == -1) @@ -334,7 +334,7 @@ class ChanLun_BTC_30(IStrategy): ['enter_long', 'enter_tag']] = (1, 'long_signal_chan') dataframe.loc[ ( - (dataframe[state_str].shift(shift_time) == "10") + (dataframe[state_str].shift(shift_time) == "20") #(dataframe[fx_str].shift(shift_time) == 1) #(dataframe[chanpy_state_str].shift(shift_time+30) == -1) #(dataframe['resample_{}_state'.format(self.get_ticker_indicator()*self.time5)].shift(self.time5) == "-10") &