OPEN-SOURCE SCRIPT

خطوط عمودی تایم‌فریم

//version=5
indicator("خطوط عمودی تایم‌فریم", overlay=true)

var line_color_daily = color.new(color.blue, 50) // رنگ خطوط روزانه
var line_color_weekly = color.new(color.green, 50) // رنگ خطوط هفتگی
var line_color_monthly = color.new(color.red, 50) // رنگ خطوط ماهانه

// بررسی تایم‌فریم
is_daily = timeframe.isintraday and timeframe.multiplier == 5 or timeframe.multiplier == 30
is_weekly = timeframe.isintraday and timeframe.multiplier == 60
is_monthly = timeframe.isintraday and timeframe.multiplier == 240

// رسم خطوط روزانه
if is_daily and ta.change(time("D")) != 0
line.new(x1=bar_index, y1=high, x2=bar_index, y2=low, color=line_color_daily, width=1)

// رسم خطوط هفتگی
if is_weekly and ta.change(time("W")) != 0
line.new(x1=bar_index, y1=high, x2=bar_index, y2=low, color=line_color_weekly, width=2)

// رسم خطوط ماهانه
if is_monthly and ta.change(time("M")) != 0
line.new(x1=bar_index, y1=high, x2=bar_index, y2=low, color=line_color_monthly, width=3)
Cycles

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer