0
Boll = color.black
if close[0] > high[30] 
    Boll := white
else if close[0] < low[30]
    Boll := blue
else
    Boll := brown

    SqueezeExpand = color.white
if Boll == color.white and Boll1 == color.white and Boll2 == color.white and Boll3 == color.white Boll4 == color.white 
    SqueezeExpand := green
else if Boll == color.blue and Boll1 == color.blue and Boll2 == color.blue and Boll3 == color.blue Boll4 == color.blue    
    SqueezeExpand := red
else 
    SqueezeExpand := color.gray

The undeclared identifier starts when I try to make Boll == white/blue/brown in an if condition alongside other conditions.

ArchBack
  • 25
  • 5

1 Answers1

0

You have pine version issues.

Starting from v4, colors have been moved to color.* namespace (e.g. color.black, color.white etc.). Before that, it was just the color names (e.g. black, white etc.).

Boll = color.black
if close[0] > high[30] 
    Boll := color.white
else if close[0] < low[30]
    Boll := color.blue
else
    Boll := color.brown
vitruvius
  • 15,740
  • 3
  • 16
  • 26
  • It is still undeclared when I try to make the == in if Boll == color.white and Boll1 == color.green and Boll2 == color. blue etc etc. – ArchBack Dec 01 '22 at 08:40
  • Please share your complete code. – vitruvius Dec 01 '22 at 08:44
  • SqueezeExpand = color.white if Boll == color.white and Boll1 == color.white and Boll2 == color.white and Boll3 == color.white Boll4 == color.white SqueezeExpand := green else if Boll == color.white and Boll1 == color.white and Boll2 == color.white and Boll3 == color.white Boll4 == color.white SqueezeExpand := red else SqueezeExpand := color.gray Boll = color.black if close[0] > high[30] Boll := color.white else if close[0] < low[30] Boll := color.blue else Boll := color.brown – ArchBack Dec 01 '22 at 09:05
  • I added an edit in my original OP. – ArchBack Dec 01 '22 at 12:51