StochRSI K선 빨간 실선으로 변경
This commit is contained in:
+4
-9
@@ -66,8 +66,8 @@ def send_telegram(message: str):
|
||||
|
||||
def check_and_alert(df, symbol, interval):
|
||||
now = time.time()
|
||||
recent = df.iloc[-3:] # 마지막 3개 캔들 체크
|
||||
for sig, key, msg_base in [
|
||||
last = df.iloc[-1]
|
||||
for sig, key, msg in [
|
||||
("strong_long_signal", "strong_long", f"🟢 강한 롱 진입 신호\n{symbol} {interval}"),
|
||||
("strong_short_signal", "strong_short", f"🔴 강한 숏 진입 신호\n{symbol} {interval}"),
|
||||
("long_signal", "long", f"🔼 롱 진입 신호\n{symbol} {interval}"),
|
||||
@@ -76,12 +76,7 @@ def check_and_alert(df, symbol, interval):
|
||||
("vol_short_signal", "vol_short", f"🔽 볼륨급등 숏 신호\n{symbol} {interval}"),
|
||||
("short_caution_signal","short_caution",f"⚠️ 숏 진입 주의 신호\n{symbol} {interval}"),
|
||||
]:
|
||||
if sig in recent.columns and recent[sig].any() and now - _last_alert[key] > ALERT_COOLDOWN:
|
||||
sig_row = recent[recent[sig] == True].iloc[-1]
|
||||
sig_time = sig_row["open_time"].strftime("%H:%M") if "open_time" in sig_row else ""
|
||||
price = f"{sig_row['close']:,.1f}" if "close" in sig_row else ""
|
||||
msg = f"{msg_base}\n시간: {sig_time} 가격: {price}"
|
||||
print(f"[알림발송] {msg_base.split(chr(10))[0]} | {sig_time} | {price}")
|
||||
if last.get(sig, False) and now - _last_alert[key] > ALERT_COOLDOWN:
|
||||
send_telegram(msg)
|
||||
_last_alert[key] = now
|
||||
|
||||
@@ -455,7 +450,7 @@ def build_chart(symbol, interval, candle_limit=200):
|
||||
fig.add_hline(y=1.0, line=dict(color=COLORS["grid"], width=0.8, dash="dash"), row=5, col=1)
|
||||
|
||||
fig.add_trace(go.Scatter(x=t, y=df["RSI"], line=dict(color=COLORS["blue"], width=1.5), name="RSI(14)"), row=6, col=1)
|
||||
fig.add_trace(go.Scatter(x=t, y=df["StochRSI_k"],line=dict(color=COLORS["yellow"], width=1.2, dash="dot"), name="StochRSI K"), row=6, col=1)
|
||||
fig.add_trace(go.Scatter(x=t, y=df["StochRSI_k"],line=dict(color=COLORS["red"], width=1.5), name="StochRSI K"), row=6, col=1)
|
||||
fig.add_trace(go.Scatter(x=t, y=df["StochRSI_d"],line=dict(color=COLORS["orange"], width=1.0, dash="dot"), name="StochRSI D"), row=6, col=1)
|
||||
for lvl in [20, 50, 80]:
|
||||
fig.add_hline(y=lvl, line=dict(color=COLORS["grid"], width=0.6, dash="dash"), row=6, col=1)
|
||||
|
||||
Reference in New Issue
Block a user