0

Is anyone familiar with Pinescript 5.I mean,I can't figure out why this work in Pinescript 2 and not in Pinescript 5

buying = l3_0 > threshold ? true : l3_0 < -threshold ? false : buying[1]

Error : Undeclared identifier 'buying'

vitruvius
  • 15,740
  • 3
  • 16
  • 26
Chris
  • 3
  • 2

1 Answers1

0

It is because Self-referenced variables are removed in v3.

You need to declare the variable first.

buying = false
buying := l3_0 > threshold ? true : l3_0 < -threshold ? false : buying[1]
vitruvius
  • 15,740
  • 3
  • 16
  • 26