Sebelum membaca artikel ini, baca yuk klik pusat rebate untuk trading optimal

Tradingview Previous Daily/Weekly High Low Close and EMA

I made my pinescript code from ChatGPT and they unpublish it because it doesnt meet they requirement. So i just publish here in my personal blog, to anybody who might need it.

indicator("Previous Daily/Weekly Candle and EMA", overlay=true)

// Daily Timeframe
dailyHigh =, "D", high[1], lookahead=barmerge.lookahead_on)
dailyLow =, "D", low[1], lookahead=barmerge.lookahead_on)
dailyClose =, "D", close[1], lookahead=barmerge.lookahead_on)

// Weekly Timeframe for the previous week
weeklyHigh =, "W", high[1], lookahead=barmerge.lookahead_on)
weeklyLow =, "W", low[1], lookahead=barmerge.lookahead_on)
weeklyClose =, "W", close[1], lookahead=barmerge.lookahead_on)

// EMA 20
ema20 = ta.ema(close, 20)

// Plotting Previous Daily Candle as Line
plot(dailyHigh,, linewidth=2, title="Prev Daily High")
plot(dailyLow,, linewidth=2, title="Prev Daily Low")
plot(dailyClose,, linewidth=2, title="Prev Daily Close")

// Plotting Previous Weekly Candle as Line
plot(weeklyHigh,, 0), linewidth=4, title="Prev Weekly High")
plot(weeklyLow,, 0), linewidth=4, title="Prev Weekly Low")
plot(weeklyClose,, 0), linewidth=4, title="Prev Weekly Close")

// Plotting EMA 20
plot(ema20,, linewidth=2, title="EMA 20")

Here we go, happy trading ...


point bellow