Nicolas

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
Round number - Sweet spot Screener

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: 214
Nicolas
Nicolas Legend
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

s00071609
6 years ago
#

I meant not plotting 4, 6 and 7. This question about having 1,3,5,8 sequence was meant to be in indicator section. If possible. I wanted to see if plotting this is possible: Plot 1 and 2 numbers, add 1+2=3, then add 2+3=5, then 3+5=8

s00071609
6 years ago
#

Is it possible to have fibo numbers like 1, 2, 3, 5,8 sequence by modifying the calculation?

Nicolas
6 years ago
#

sorry i dont get it. you want to plot the next level at current price + ratio?

ProRealCode ProRealCode
Loading...