1

why plot(p.x) behaves differently from plot(y) (please see the comments in the script below):

//@version=5
indicator("My script")

type pp
    float x

p = pp.new(1)


p.x :=1
y = 5
plot(p.x)   // plots 1
plot(y)     // plots 5

p.x:=2
y := 6 
plot(p.x)   // plots 1, not 2. Why?
plot(y)     // plots 6
Moebius
  • 329
  • 1
  • 7
  • 3
    This is a known bug which came up recently. Once you put `p.x` in a `plot()`, its value freezes. If you comment out the first `plot(p.x)`, you will see that its value will change to `2` and the second plot will display 2. Thanks for reporting. – vitruvius Feb 27 '23 at 07:04

0 Answers0