You are on page 1of 2

//ColorCoded ATR Percentage Indicator for PRT//

//Red = Volatile//

//Green = Normal//

//Blue = Quiet//

ATRP = (averagetruerange[21](close)/close)*100

atrpma = average[504](atrp)

ATRPSD = STD[504](ATRP)

if ATRP > (ATRPMA + 1*ATRPSD) then

VolColRed = 1

Else

VolColRed = 0

endif

if ATRP <= (ATRPMA + 1*ATRPSD) and ATRP >= (ATRPMA - 1*ATRPSD) then

VolColGreen = 1

Else

VolColGreen = 0

endif

if ATRP < (ATRPMA - 1*ATRPSD) then

VolColBlue = 1

Else

VolColBlue = 0

endif

Volatile = VolColRed = 1

Normal = VolColGreen = 1

Quiet = VolColBlue = 1

if volatile then

r = 255
else

r=0

endif

if Normal then

g = 255

else

g=0

endif

if Quiet then

b = 255

else

b=0

endif

Return ATRP coloured (R,G,B) as "ATRP"

You might also like