Hi,
Please help with an indicator showing the High-low difference value displayed just above the relevant candle.
Shown vertically not horizontally.
Text size to be the with of the candle. Trying to prevent lapping of text
Regards,
Segie
There you go:
//DEFPARAM DrawOnLastBarOnly = true
thisRANGE = range / PipSize
Offset = 40*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,10)
ENDIF
IF range2 > 0 OR (range2 = 0 and range1 > 0) THEN
DrawText("#range2#",BarIndex,high + Offset*1.5,dialog,bold,10)
ENDIF
IF range3 > 0 OR (range3 = 0 and (range2 + range1 > 0)) THEN
DrawText("#range3#",BarIndex,high + Offset*1.0,dialog,bold,10)
ENDIF
DrawText("#range4#",BarIndex,high + Offset*0.5,dialog,bold,10)
RETURN
this will plot the range (high – low) with NO decimal point, above each candle. To plot it only on the last candle, uncomment line 1.
Line 3 is the value to space the lines from each orther, this is for DAXm, 1-hour TF; on DAX, Daily TF, 100 seems more appropriate. So you will have to adjust it yourself.
With this version you can easily change the character size (default is 10) and the colour for each digit (transparency included):
//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
Please see attached error
Import the ITF file (or try again doing Copy & Paste).