Bollinger Band colours
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Forums › ProRealTime English forum › ProBuilder support › Bollinger Band colours
Good afternoon guys, i wonder if anyone can help. I am trying to colour my upper and lower Bollinger bands Green when the middle moving average is rising and Red when the middle Moving average is falling. Can someone help please? Ive copied the basic code for the Bollinger Bands themselves. Thanks for any help you can share!
Best regards
|
1 2 3 4 5 |
a=average [21] (close) b=STD[21](close) Bollup= BollingerUp[21](close) Bolldn=BollingerDown[21](close) Return Bollup,Bolldn,a |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
LRS = LinearRegressionSlope[21](close) If LRS > 0 then Bullish = 1 Bearish = 0 R = 0 G = 255 B = 0 ElsIf LRS < 0 then Bullish = 0 Bearish = 1 R = 255 G = 0 B = 0 Else Bullish = 0 Bearish = 0 R = 0 G = 0 B = 255 EndIf Avg = Average[21](close) Bollup= BollingerUp[21](close) Bolldn=BollingerDown[21](close) Return Bollup Coloured(R,G,B) as "BollingerUp" ,Bolldn Coloured(R,G,B) as "BollingerDown",Avg Coloured(R,G,B) Style(DottedLine) |
Hi @Alfy
To determine the direction of the average, you can use the Linear Regression Slope.