This commit is contained in:
dsyoon
2025-08-06 14:52:26 +09:00
parent a8b8f37f3f
commit 74c179dd3c

View File

@@ -127,7 +127,12 @@ def check_buy_point(data, simulation=None):
else:
recent_data = data.tail(10)
recent_data['buy_point'] = 0
# SettingWithCopyWarning 해결
recent_data.loc[:, 'buy_point'] = 0
# FutureWarning 해결
if recent_data['buy_point'].iloc[-1] != 1:
# 코드 계속
for i in range(1, len(recent_data)):
if all(recent_data[f'MA{n}'].iloc[i] < recent_data['MA720'].iloc[i] for n in [5, 20, 40, 120, 200, 240]) and \
all(recent_data[f'MA{n}'].iloc[i] > recent_data[f'MA{n}'].iloc[i-1] for n in [5, 20, 40, 120, 200, 240]) and \
@@ -136,7 +141,7 @@ def check_buy_point(data, simulation=None):
if not simulation:
if recent_data['buy_point'][-10:-1].sum() > 0:
recent_data['buy_point'][-1] = 1
recent_data.at[recent_data.index[-1], 'buy_point'] = 1
return recent_data
@@ -261,7 +266,7 @@ def monitor_us_stocks():
try:
data = calculate_technical_indicators(data)
recent_data = check_buy_point(data) # Changed to check_buy_point
if recent_data['buy_point'][-1] != 1:
if recent_data['buy_point'].iloc[-1] != 1:
continue
print(f" - {US_STOCKS[symbol]} ({symbol}): {recent_data['Close'][-1]:.2f}")
message_list.append(format_message('US', symbol, US_STOCKS[symbol], recent_data['Close'][-1]))
@@ -292,7 +297,7 @@ def monitor_kr_stocks():
try:
data = calculate_technical_indicators(data)
recent_data = check_buy_point(data) # Changed to check_buy_point
if recent_data['buy_point'][-1] != 1:
if recent_data['buy_point'].iloc[-1] != 1:
continue
print(f" - {KR_ETFS[symbol]} ({symbol}): {recent_data['Close'][-1]:.2f}")
message_list.append(format_message('KR', symbol, US_STOCKS[symbol], recent_data['Close'][-1]))
@@ -332,7 +337,7 @@ def monitor_coins():
try:
data = calculate_technical_indicators(data)
recent_data = check_buy_point(data) # Changed to check_buy_point
if recent_data['buy_point'][-1] != 1:
if recent_data['buy_point'].iloc[-1] != 1:
continue
print(f" - {KR_ETFS[symbol]} ({symbol}): {recent_data['Close'][-1]:.2f}")
message_list.append(format_message('COIN', symbol, US_STOCKS[symbol], recent_data['Close'][-1]))
@@ -412,4 +417,5 @@ def run_schedule():
if __name__ == "__main__":
run_schedule()
#run_schedule()
monitor_coins()