Round number - Sweet spot Screener

Category: Screeners By: Nicolas Created: April 4, 2018, 9:24 AM
April 4, 2018, 9:24 AM
Screeners
3 Comments

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]

 

Download
Filename: PRC_RoundNumber-touch-Screener.itf
Downloads: 213
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...