스토캐스틱, RSI 추가
This commit is contained in:
@@ -506,7 +506,7 @@ class HTS_122630:
|
||||
return
|
||||
|
||||
def checkTransaction(self, data):
|
||||
size = len(data["Close"])
|
||||
size = len(data["close"])
|
||||
|
||||
bsLine = {}
|
||||
bsLine['buy'] = [-1 for i in range(size)]
|
||||
@@ -575,8 +575,8 @@ class HTS_122630:
|
||||
data = self.buySellChecker.analyze(result)
|
||||
# 사야 할 시점/가격과 팔아야 할 시점/가격을 체크한다.
|
||||
bs_buy_price, bs_weight, bs_sell_price = self.checkTransaction(data)
|
||||
data_size = len(data["Close"])
|
||||
final_price = data["Close"][data_size - 1]
|
||||
data_size = len(data["close"])
|
||||
final_price = data["close"][data_size - 1]
|
||||
|
||||
if bs_buy_price > 0:
|
||||
# 기본 100 주에 가중치를 추가해서 매수한다.
|
||||
|
||||
@@ -506,7 +506,7 @@ class HTS_252670:
|
||||
return
|
||||
|
||||
def checkTransaction(self, data):
|
||||
size = len(data["Close"])
|
||||
size = len(data["close"])
|
||||
|
||||
bsLine = {}
|
||||
bsLine['buy'] = [-1 for i in range(size)]
|
||||
@@ -575,8 +575,8 @@ class HTS_252670:
|
||||
data = self.buySellChecker.analyze(result)
|
||||
# 사야 할 시점/가격과 팔아야 할 시점/가격을 체크한다.
|
||||
bs_buy_price, bs_weight, bs_sell_price = self.checkTransaction(data)
|
||||
data_size = len(data["Close"])
|
||||
final_price = data["Close"][data_size-1]
|
||||
data_size = len(data["close"])
|
||||
final_price = data["close"][data_size-1]
|
||||
|
||||
if bs_buy_price > 0:
|
||||
# 기본 100 주에 가중치를 추가해서 매수한다.
|
||||
|
||||
@@ -544,7 +544,7 @@ class HTS:
|
||||
upper_temp = [upper[i] for i in range(size) if i % window == 0]
|
||||
lower_temp = [lower[i] for i in range(size) if i % window == 0]
|
||||
|
||||
temp = {"Date": point_temp, "Open": open, "High": high, "Low": low, "Close": close, "Volume": vol, "ma2": ma2, "ma5": ma5, "ma10": ma10, "ma20": ma20, "ma30": ma30, "ma40": ma40, "ma50": ma50, "ma60": ma60}
|
||||
temp = {"Date": point_temp, "Open": open, "High": high, "Low": low, "close": close, "Volume": vol, "ma2": ma2, "ma5": ma5, "ma10": ma10, "ma20": ma20, "ma30": ma30, "ma40": ma40, "ma50": ma50, "ma60": ma60}
|
||||
data = pd.DataFrame(temp)
|
||||
df_final_time = pd.DatetimeIndex(point_temp)
|
||||
data.index = df_final_time
|
||||
@@ -559,7 +559,7 @@ class HTS:
|
||||
data['Open'] = pd.to_numeric(data['Open'])
|
||||
data['High'] = pd.to_numeric(data['High'])
|
||||
data['Low'] = pd.to_numeric(data['Low'])
|
||||
data['Close'] = pd.to_numeric(data['Close'])
|
||||
data['close'] = pd.to_numeric(data['close'])
|
||||
data['Volume'] = pd.to_numeric(data['Volume'])
|
||||
data['ma2'] = pd.to_numeric(data['ma2'])
|
||||
data['ma5'] = pd.to_numeric(data['ma5'])
|
||||
@@ -600,7 +600,7 @@ class HTS:
|
||||
ma60 = go.Scatter(x=data['Date'], y=data['ma60'], name="ma60", line_color='#14279B')
|
||||
|
||||
|
||||
candle_stick = go.Candlestick(x=data['Date'], open=data['Open'], high=data['High'], low=data['Low'], close=data['Close'], increasing_line_color='red', decreasing_line_color='blue')
|
||||
candle_stick = go.Candlestick(x=data['Date'], open=data['Open'], high=data['High'], low=data['Low'], close=data['close'], increasing_line_color='red', decreasing_line_color='blue')
|
||||
|
||||
# 그래프를 그린다.
|
||||
fig = go.Figure(data=[candle_stick, bolinger_upper, bolinger_lower, buy_check, sell_check, ma2, ma10, ma20, ma30, ma40, ma50, ma60])
|
||||
@@ -611,7 +611,7 @@ class HTS:
|
||||
def checkTransaction(self, data, upper, lower):
|
||||
low = data["Low"]
|
||||
high = data["High"]
|
||||
close = data["Close"]
|
||||
close = data["close"]
|
||||
open = data["Open"]
|
||||
ma2 = data["ma2"]
|
||||
ma5 = data["ma5"]
|
||||
@@ -834,7 +834,7 @@ class HTS:
|
||||
def checkTransaction(self, data, upper, lower):
|
||||
low = data["Low"]
|
||||
high = data["High"]
|
||||
close = data["Close"]
|
||||
close = data["close"]
|
||||
open = data["Open"]
|
||||
ma2 = data["ma2"]
|
||||
ma5 = data["ma5"]
|
||||
|
||||
Reference in New Issue
Block a user