Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

// © Silent_Sea

//@version=5
indicator("PDH + PDL", shorttitle="PDHL", overlay=true)
// Define the session type
isess = session.regular

// Get ticker information


t = ticker.new(syminfo.prefix, syminfo.ticker, session=isess)

// Set barmerge parameters


igaps = input(false, title="Merge Gaps")

// Get previous day's high, low, and close


yesterdayHigh = request.security(t, "D", high[1], lookahead=barmerge.lookahead_on)
yesterdayLow = request.security(t, "D", low[1],lookahead=barmerge.lookahead_on)
yesterdayClose = request.security(t, "D", close[1],lookahead=barmerge.lookahead_on)

// Draw a line connecting the previous day high and low


line.new(na, yesterdayHigh, bar_index, yesterdayHigh, width=1, color=color.blue)
line.new(na, yesterdayLow, bar_index, yesterdayLow, width=1, color=color.red)

length1 = input(9, title = "EMA 1 Lenghth")


length2 = input(21, title = "EMA 2 Lenghth")
length3 = input(50, title = "EMA 3 Lenghth")
length4 = input(100, title = "EMA 4 Lenghth")

ema1 = ta.ema(close,length1)
ema2 = ta.ema(close,length2)
ema3 = ta.ema(close,length3)
ema4 = ta.ema(close,length4)

plot(ema1, color=color.red,title="EMA1")
plot(ema2, color=color.rgb(172, 222, 34),title="EMA2")
plot(ema3, color=color.rgb(82, 85, 255),title="EMA3")
plot(ema4, color=color.rgb(255, 82, 206),title="EMA4")

You might also like