The SweetSpots indicator plots automatically lines on round price rates, not only double zeros, it includes any round numbers calculated with 2 different settings in parameters:
The ‘NumLinesAboveBelow’ setting will determine how much levels will be plotted on the chart (default is 100 lines above and below the current Close).
//PRC_SweetSpots round number | indicator
//04.12.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
// NumLinesAboveBelow = 100
// MainLevels = 100
// SubLevels = 20
// --- end of settings
defparam drawonlastbaronly=true
DecAr = MainLevels*pointsize
DecArSub = SubLevels*pointsize
myVarUp = close
myVarDn = close
myVarUpSub = close
myVarDnSub = close
if DecAr = 0 then
InvDec = 1
else
InvDec = 1/DecAr
endif
if DecArSub = 0 then
InvDecSub = 1
else
InvDecSub = 1/DecArSub
endif
for i = 0 to NumLinesAboveBelow do
Floor = round(InvDec*myVarDn-0.51)/InvDec
Ceil = round(InvDec*myVarUp+0.51)/InvDec
FloorSub = round(InvDecSub*myVarDnSub-0.51)/InvDecSub
CeilSub = round(InvDecSub*myVarUpSub+0.51)/InvDecSub
r=255
g=215
floorval=floorsub
ceilval=ceilsub
drawhline(floorval) coloured(r,g,0)
drawhline(ceilval) coloured(r,g,0)
drawrectangle(1,floor,barindex,floor) coloured(r,0,0)
drawrectangle(1,ceil,barindex,ceil) coloured(r,0,0)
myVarUp=Ceil
myVarDn=Floor
myVarUpSub=CeilSub
myVarDnSub=FloorSub
next
return