VWAP Scan Percentage


Category:
0
0

Hi Hahn,

I wanted to know if you could create a scan criteria that will show stocks whose price is within a certain percentage of the VWAP, above or below.  Call it 5% for the purposes of this question.  I would prefer if it used the mark or last price rather than the close to make this an open candle indicator/scanner but I’m not sure if that’s a possibility or if it makes a difference.  I’ve looked through your other VWAP scan questions in the forum and do not have the knowledge to tweak them to my needs.  If a percentage is not a possibility, I would be interested in changing the perimeters to be within a certain dollar value instead.  Call it $0.05.

 

Thank you

RESOLVED
Marked as spam
Posted by (Questions: 3, Answers: 1)
Asked on December 6, 2018 4:48 pm
623 views
0
Private answer

Because the source code for the VWAP study is several dozen lines I am going to break from my rules and reference the VWAP study rather than use the entire source code.

def data = reference VWAP()."VWAP";
plot scan = (close < data * 1.05 and close >= data) or (close > data * .95 and close <= data);

I think that should do the trick. Give it a try and let us know.

Marked as spam
Posted by (Questions: 37, Answers: 4079)
Answered on December 7, 2018 8:16 am
0
Hi Pete, I know it’s an old thread but indeed this works great! I happened upon this request in search of a similar idea; what I’m looking for is a watchlist column that shows the price’s percent distance from VWAP, calculated to at least .1. I have made one that displays the absolute price from VWAP (based on close of last bar), but don’t know how to make it based on percent distance from VWAP instead. Do you know if this is possible? Many thanks for your consideration!
( at February 23, 2022 11:11 am)
0

The formula to compute the percent change between two values is: 100 x (secondValue / firstValue – 1). You replace the secondValue and firstValue with your specific variables to compute this for whatever metrics you want to measure. That’s about all I can provide at this point.

( at February 23, 2022 12:40 pm)
0
It may be just a single line of code, but I had been stumped on this one for days, thank you so much Pete!!
( at February 23, 2022 1:38 pm)
0
I suggest you post that request as a new question in the "Watch Lists" topic. In this forum I try to stick to one topic for each question. This post is for a scan and not for a watchlist column. So a solution for a watchlist column would be out of context and it would be impossible for other viewers to locate it using the search function.
( at February 23, 2022 2:45 pm)