This commit is contained in:
dsyoon
2025-09-01 12:08:32 +09:00
parent 2b4d0019ae
commit c1f12cd4ea
3 changed files with 62 additions and 39 deletions

View File

@@ -229,8 +229,8 @@ class Monitor(HTS):
try:
# 신호 생성 및 최신 포인트 확인
data = self.annotate_signals(symbol, data)
if data['point'].iloc[-1] != 1:
return False
#if data['point'].iloc[-1] != 1:
# return False
# 인버스 데이터: 매수 신호를 매도로 처리 (fall_6p, deviation40 만 허용)
if is_inverse:
@@ -283,11 +283,11 @@ class Monitor(HTS):
# Ignore errors in MA calculation so as not to block trading logic
pass
buy_amount = 6000
buy_amount = 5100
current_time = datetime.now()
if data['signal'].iloc[-1] == 'fall_6p':
if data['Close'].iloc[-1] > 100:
buy_amount = 500000
buy_amount = 600000
else:
buy_amount = 300000
@@ -305,24 +305,32 @@ class Monitor(HTS):
print(f"{symbol}: 매수 금지 중 (남은 시간: {1800 - time_diff.total_seconds():.0f}초)")
return False
buy_amount = 5100
if data['signal'].iloc[-1] == 'movingaverage':
buy_amount = 30000
buy_amount = 100000
elif data['signal'].iloc[-1] == 'deviation40':
buy_amount = 50000
buy_amount = 500000
elif data['signal'].iloc[-1] == 'deviation240':
buy_amount = 6000
buy_amount = 60000
elif data['signal'].iloc[-1] == 'deviation1440':
if symbol in ['BONK', 'PEPE', 'TON']:
buy_amount = 20000
buy_amount = 200000
else:
buy_amount = 30000
# heikin_ashi 조건 제거 완료
buy_amount = 300000
if data['signal'].iloc[-1] in ['movingaverage', 'deviation40', 'deviation240', 'deviation1440']:
if check_5_week_lowest:
buy_amount *= 4
# 분봉 시스널이 없을 때는 이전 봉보다 높으면 60분 마다 매수
if data['point'].iloc[-1] != 1:
buy_amount = 30000
last_buy_dt = self.buy_cooldown.get(symbol, {}).get('buy', {}).get('datetime')
if last_buy_dt:
time_diff = current_time - last_buy_dt
if time_diff.total_seconds() < 3600:
print(f"{symbol}: 매수 금지 중 (남은 시간: {3600 - time_diff.total_seconds():.0f}초)")
return False
_ = self.hts.buyCoinMarket(symbol, buy_amount)
if self.cooldown_file is not None:
@@ -554,6 +562,7 @@ class Monitor(HTS):
data = self.get_coin_data(symbol, interval)
data_1 = self.get_coin_data(symbol, interval=1)
data_1.at[data_1.index[-1], 'Volume'] = data_1['Volume'].iloc[-1] * 60
saved_data = self.get_coin_saved_data(symbol, interval, data)
data = pd.concat([data, saved_data, data_1.iloc[[-1]]], ignore_index=True)
data['datetime'] = pd.to_datetime(data['datetime'], format='%Y-%m-%d %H:%M:%S')