Scan for inside bars near VWAP


Category:
0
0

Hi Pete.  In a previous post you provided an awesome code that scans for inside bars. Below I have provided the link to the prior post as well as the code.  Is there a way to modify the code so it will only scan for stocks with inside bars  that touched the VWAP?



Link: https://www.hahn-tech.com/ans/scan-for-inside-bars/



def count = 2;

def range = high – low;

#def priorrange = high[1] – low[1];

def priorrange = range[1];

def nibsize = absvalue(((open – close) / (open[1] – close[1])-1));

def sizeConstraint = absvalue((range / priorrange)-1) >= .5 and nibsize >= .5;

def hiLowContraint = high <=high[1] and low >= low[1];

def inside_bar = hiLowContraint;

#plot s = inside_bar && lowest(range,count);

plot scan = inside_bar[0];

AssignPriceColor(if inside_bar then Color.WHITE else Color.CURRENT);

Marked as spam
Posted by (Questions: 19, Answers: 18)
Asked on August 15, 2019 5:12 pm
152 views
0
Private answer

No code required for that. Just use the Condition Wizard. After you have added that code to your scan, add a second Study Filter and use the Condition Wizard to add a new filter for the VWAP. Screenshots below show the steps required. We have an entire video dedicated to the Condition Wizard. You can check it out here:

https://www.hahn-tech.com/thinkorswim-condition-wizard/

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on August 16, 2019 2:28 pm
0
Hi Pete. Thank you for the Condition Wizard video! I was not only able to scan for inside bars, but was also able to set up a scan for inside bars followed by engulfing candles thanks to your video. Thanks much!
( at September 3, 2019 3:55 pm)
0
Hi Corey, can you share it? Thanks.
( at April 9, 2020 1:53 pm)