Max
Max

Reputation: 37

Pinescript - Premarket high low query

I would like to query the highest and lowest price from the premarket session and draw a line at these two prices. I tried this:

if session.ispremarket 
    pmHigh := high
    pmLow := low

x1 = line.new(bar_index, pmHigh, bar_index + 1, pmHigh, color = #e21717e6, width = 2)
x2 = line.new(bar_index, pmLow, bar_index + 1, pmLow, color = #0ceb1fe6, width = 2)

Unfortunately the line is not displayed correctly. Or several lines are displayed

Upvotes: 0

Views: 51

Answers (0)

Related Questions