开始交易
This commit is contained in:
+2
-2
@@ -78,12 +78,12 @@ class ChanKLC():
|
|||||||
self.klc_fx_type = Chan_KLC_FX.BOTTOM4
|
self.klc_fx_type = Chan_KLC_FX.BOTTOM4
|
||||||
if self.fx == Chan_FX_TYPE.TOP:
|
if self.fx == Chan_FX_TYPE.TOP:
|
||||||
#print(self.end_time, self.fx, self.macd, self.macdhist, len(self.klus))
|
#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.klc_fx_type = Chan_KLC_FX.TOP5
|
||||||
self.bb_out = True
|
self.bb_out = True
|
||||||
else:
|
else:
|
||||||
if self.fx == Chan_FX_TYPE.BOTTOM:
|
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.klc_fx_type = Chan_KLC_FX.BOTTOM5
|
||||||
self.bb_out = True
|
self.bb_out = True
|
||||||
|
|
||||||
|
|||||||
@@ -96,10 +96,14 @@ class ChanLun():
|
|||||||
klc_index += 1
|
klc_index += 1
|
||||||
if klc.klc_fx_type == Chan_KLC_FX.TOP4:
|
if klc.klc_fx_type == Chan_KLC_FX.TOP4:
|
||||||
state_list.append("10")
|
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)
|
#print(klc.start_time, klc.end_time, klc.klc_fx_type)
|
||||||
elif klc.klc_fx_type == Chan_KLC_FX.BOTTOM4:
|
elif klc.klc_fx_type == Chan_KLC_FX.BOTTOM4:
|
||||||
state_list.append("-10")
|
state_list.append("-10")
|
||||||
#print(klc.start_time, klc.end_time, klc.klc_fx_type)
|
#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:
|
else:
|
||||||
state_list.append("00")
|
state_list.append("00")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
#sys.path.append(os.path.abspath("/Users/jack/Documents/GitHub/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"))
|
#sys.path.append(os.path.abspath("/Users/jack/Project/chan.py"))
|
||||||
from Chan import CChan
|
from Chan import CChan
|
||||||
from BuySellPoint.BS_Point import CBS_Point
|
from BuySellPoint.BS_Point import CBS_Point
|
||||||
from ChanConfig import CChanConfig
|
from ChanConfig import CChanConfig
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class ChanLun_BTC_30(IStrategy):
|
|||||||
time30 = 30
|
time30 = 30
|
||||||
time60 = 60
|
time60 = 60
|
||||||
time4h = 240
|
time4h = 240
|
||||||
time30 = 60
|
time30 = 15
|
||||||
last_time = datetime.now()
|
last_time = datetime.now()
|
||||||
chan = ChanLun()
|
chan = ChanLun()
|
||||||
chanpy = ChanPY()
|
chanpy = ChanPY()
|
||||||
@@ -321,7 +321,7 @@ class ChanLun_BTC_30(IStrategy):
|
|||||||
shift_time = self.time30
|
shift_time = self.time30
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
(dataframe[state_str].shift(shift_time) == "-10")
|
(dataframe[state_str].shift(shift_time) == "-20")
|
||||||
#(dataframe['state'] == "-30")
|
#(dataframe['state'] == "-30")
|
||||||
#(dataframe[state_str].shift(shift_time) == "-10")
|
#(dataframe[state_str].shift(shift_time) == "-10")
|
||||||
#(dataframe[fx_str].shift(shift_time) == -1)
|
#(dataframe[fx_str].shift(shift_time) == -1)
|
||||||
@@ -334,7 +334,7 @@ class ChanLun_BTC_30(IStrategy):
|
|||||||
['enter_long', 'enter_tag']] = (1, 'long_signal_chan')
|
['enter_long', 'enter_tag']] = (1, 'long_signal_chan')
|
||||||
dataframe.loc[
|
dataframe.loc[
|
||||||
(
|
(
|
||||||
(dataframe[state_str].shift(shift_time) == "10")
|
(dataframe[state_str].shift(shift_time) == "20")
|
||||||
#(dataframe[fx_str].shift(shift_time) == 1)
|
#(dataframe[fx_str].shift(shift_time) == 1)
|
||||||
#(dataframe[chanpy_state_str].shift(shift_time+30) == -1)
|
#(dataframe[chanpy_state_str].shift(shift_time+30) == -1)
|
||||||
#(dataframe['resample_{}_state'.format(self.get_ticker_indicator()*self.time5)].shift(self.time5) == "-10") &
|
#(dataframe['resample_{}_state'.format(self.get_ticker_indicator()*self.time5)].shift(self.time5) == "-10") &
|
||||||
|
|||||||
Reference in New Issue
Block a user