-1

Is there a option to create a variable what holds the same value over all bars. I would like to calculate a value in on a bar and use it on the next bar.

1 Answers1

0

See more about var modifier, it allows to create one instance of variable for script:

//@version=4
study("My Script")
var v = close
// plots close value of the first bar
plot(v)
Artem Nosov
  • 141
  • 2