This indicator simply plots on the chart the nearest rounded levels to the last close level.
The parameter “level” is a decimal so it can be used for forex rounded levels too.
The parameter “skip” indicates how many extra ceils and floors you want to plot above and below the last close price.
once floor = close
once ceil = close
price = close[1]
if price < floor or price > ceil then
frac = price/level
rounded = round(frac)
// computing floor and ceil (functions are not available in v10.3)
if rounded > frac then
ceil = rounded * level
floor = (rounded-1) * level
else
floor = rounded * level
ceil = (rounded+1) * level
endif
endif
// Choose one of these chars (see https://en.wikipedia.org/wiki/Dash):
// ― - — ― ‒
// ~ ∼ ➖ ⁃ ✛
// • ● ○ ∙ ◦
IBar = barindex
for skip = 0 to skips do
skipSize = skip*level
ceilLev = ceil + skipSize
floorLev = floor - skipSize
drawtext("◦", IBar, ceilLev, Dialog, Standard, 10) //coloured (255, 0, 0, 255)
drawtext("◦", IBar, floorLev, Dialog, Standard, 10) //coloured (0, 128, 0, 255)
next
return