//DEFPARAM DrawOnLastBarOnly = true
CharSize  = 10   // size of characters (digits)
t         = 255  // Transparency (or Alpha)
thisRANGE = range / PipSize
Offset    = 30*PipSize
range1    = floor(thisRANGE / 1000,0)
thisRANGE = thisRANGE mod 1000
range2    = floor(thisRANGE / 100,0)
thisRANGE = thisRANGE mod 100
range3    = floor(thisRANGE / 10,0)
range4    = thisRANGE mod 10
IF range1 > 0 THEN
   DrawText("#range1#",BarIndex,high + Offset*2.0,dialog,bold,CharSize) coloured("Black",t)
ENDIF
IF range2 > 0 OR (range2 = 0 and range1 > 0) THEN
   DrawText("#range2#",BarIndex,high + Offset*1.5,dialog,bold,CharSize) coloured("Red",t)
ENDIF
IF range3 > 0 OR (range3 = 0 and (range2 + range1 > 0)) THEN
   DrawText("#range3#",BarIndex,high + Offset*1.0,dialog,bold,CharSize) coloured("Blue",t)
ENDIF
DrawText("#range4#",BarIndex,high + Offset*0.5,dialog,bold,CharSize)    coloured("Green",t)
RETURN