Coding Bollinger-Bands

 
I'm trying to update my Bollinger bands to be more accurate this is what I have right now that's coded and what it looks like it the strategy tester then what I want it to look like in trading view any help is much appreciated!
(Close[2]<PrevLowerBB && Close[1]>LowerBB )
Files: