Williams %R


Category:
0
0

Aloha.  I use %R as part of my scans but I only have the option of selecting certain values greater than or less than or equal to and so on.  I wanted to know if there is a way to see when %R crosses above or below a value.  Any suggestions?

Marked as spam
Posted by (Questions: 1, Answers: 2)
Asked on February 5, 2017 8:58 pm
234 views
1
Private answer

This one is pretty simple so I’ll just post the full code. I’ve taken the source code from the built in study and append a few lines that will run your scan. If you need further explanation just post a comment below this answer. Don’t forget to up-vote any answers that best solve your question.

input length = 10;
input value = -20;
def hh = Highest(high, length);
def ll = Lowest(low, length);
def result = if hh == ll then -100 else (hh - close) / (hh - ll) * (-100);
def WR = if result > 0 then 0 else result;
#first scan is for finding a cross back above over sold condition
plot scan = WR[1] < -80 and WR > -80;
#secon scan is for finding a cross back below over bought condition
#plot scan = WR[1] > -20 and WR < -20;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 5, 2017 10:06 pm
0
Private answer

Good morning Pete. First thanks for responding so quickly.  Okay I really like the code that you sent. I can use it, but I was looking for sort of the opposite.  I wanted to scan for a cross above the over bought condition (greater than -20) and a scan below  the over sold condition ( less than -80).  I apologize for not being clear about my request.

Also, while using the code you posted I only got results for the cross going back above the over sold conditions.  I pasted the code in the scanner custom filter, but I’m wondering did I forget a step.  Do I need to take an additional step to trigger over bought scans?  Thanks in advance Fuzzy

Marked as spam
Posted by (Questions: 1, Answers: 2)
Answered on February 6, 2017 8:47 am
0

Very simple, just reverse the greater-than and less-than signs. So the original is this: plot scan = WR[1] < -80 and WR > -80; and we change it to this: plot scan = WR[1] < -80 and WR > -80;. Now, regarding your scan results. There are two modes to this scan. Read the comments embedded within the code and you will find that one tests for overbought condition and the other tests for oversold conditions. The are not run at the same time as only a single plot is permitted in a custom scan. I assumed that you have already viewed our videos on the topic of stock scanners and if that last bit was not apparent to you I suggest you go back and review some of those videos. Almost every scan we publish contains multiple signals that you turn on and off using the comment mark #.

( at February 6, 2017 9:49 am)
0
Private answer

Okay I’ll check out the videos.  Thanks again.

Marked as spam
Posted by (Questions: 1, Answers: 2)
Answered on February 6, 2017 10:51 am