declare upper; #===bollingerbands input price = close; input displace = 0; input length = 9; input Num_Dev_Dn = -2.0; input Num_Dev_up = 2.0; def sDev = StDev(data = price[-displace], length = length); plot MidLine = ExpAverage(data = price[-displace], length = length); plot LowerBand = MidLine + Num_Dev_Dn * sDev; plot UpperBand = MidLine + Num_Dev_up * sDev; LowerBand.SetDefaultColor(Color.white); LowerBand.SetLineWeight(1); MidLine.SetDefaultColor(Color.white); Midline.Setstyle(Curve.short_DASH); Midline.SetlineWeight(2); UpperBand.SetDefaultColor(Color.white); UpperBand.SetLineWeight(1); #========PPS BUY AND SELL SIGNALS plot buy = !IsNaN(PPS().”buySignal”); buy.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); buy.SetDefaultColor(Color.white); buy.SetLineWeight(5); plot sell = !IsNaN(PPS().”SellSignal”); sell.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); sell.SetDefaultColor(Color.MAGENTA); sell.SetLineWeight(5); #=====PPS Trend==== def PPS_trend = if buy then 1 else if sell then 0 else PPS_trend[1]; def PPStrend = PPS_trend; def cond1 = if PPSTrend==1 then lowerband else double.positive_infinity; def cond2 = if PPSTrend==0 then upperband else double.negative_infinity; input showclouds = yes; AddCloud(if showclouds then cond1 else double.nan, cond2, Color.light_GREEN, Color.pink);