// create user controlled options
bol10enabeled = 1 //boolean
bol20enabeled = 1 // boolean
// value to for bollups variables to be tested against
testvalue = 12620
// if enabled by booleans above then create variables
if bol10enabeled = 1 then
bollU10 = BollingerUp[10](close)
endif
if bol20enabeled then
bollU20 = BollingerUp[20](close)
endif
// check if the variables are enabled and test value for current bar against testvalue and add to array only if criteria =met
// the actual value in this case is irrelevant because I want to then check if the array is empty or not and change the background accordingly
// currently the array seems to contain every value for the bollup10 and bollup20 because I’m not sure how to create the array correctly!
// I need it to check for the current bar only but also paint the bars in the past where the test has been passed.
if bol10enabeled = 1 and bollU10 < testvalue then
$bollups[lastset($bollups)+1] = bollU10
endif
if bol10enabeled = 1 and bollU20 < testvalue then
$bollups[lastset($bollups)+1] = bollU20
endif
// check to see if the array is empty and if not colour the background
if isset($bollups[0]) then
backgroundcolor("grey",20)
endif
// visually check the array
for j = 1 to lastset($lp)
mybollups = $bollups[j]
drawtext("#mybollups#",barindex+5,close) coloured("green")
next
return