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);
Like this:
Like Loading...