Alart

Alart

//@version=5
indicator("شکست خط روند و پولبک با آلارم", overlay=true)

// تنظیمات خط روند
trend_line_length = input(20, title="طول خط روند")
trend_line_high = ta.highest(high, trend_line_length)
trend_line_low = ta.lowest(low, trend_line_length)

// رسم خط روند
line.new(bar_index , trend_line_high, bar_index, trend_line_high, color=color.red, width=2)
line.new(bar_index , trend_line_low, bar_index, trend_line_low, color=color.green, width=2)

// شرایط شکست خط روند
trend_line_break = close > trend_line_high or close < trend_line_low

// شرایط پولبک
pullback_condition = (close < trend_line_high and close > trend_line_low) and trend_line_break

// فعال‌سازی آلارم
alertcondition(pullback_condition, title="پولبک پس از شکست خط روند", message="پولبک پس از شکست خط روند رخ داده است!")

// نمایش پیام در کنسول
if pullback_condition
label.new(bar_index, high, text="پولبک پس از شکست خط روند", style=label.style_circle, color=color.blue, textcolor=color.white)


Read More

Share:

Latest News