This screener code will detect price breakout / reversal over round numbers (or “sweet spots”).
They are 2 different levels that the screener can detect, the Main and the Sub ones. You can change them in the code between settings lines.
The screener is made of this indicator: Sweet Spots & round numbers
//PRC_RoundNumber touch Screener | screener
//30.03.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
MainLevels = 100
SubLevels = 50
// --- end of settings
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
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
myVarUp=Ceil
myVarDn=Floor
myVarUpSub=CeilSub
myVarDnSub=FloorSub
crossover = close crosses over myVarUp[1] or close crosses over myVardn[1] or close crosses over myvarupsub[1] or close crosses over myvardnsub[1]
crossunder = close crosses under myVarUp[1] or close crosses under myVardn[1] or close crosses under myvarupsub[1] or close crosses under myvardnsub[1]
test = crossover or crossunder
screener[test]