StockFetcher Forums · General Discussion · ATR above BB issue<< >>Post Follow-up
sachko
1 posts
msg #158857
Ignore sachko
modified
3/22/2022 12:29:07 PM

I'm trying to make a filter to find a chart pattern I like when I look on yahoo. On Yahoo, I use ATR Bands. The ATR, 21 days, based on close, shifted 3 units above and below the close. I then want the upper limit to be above the upper BB, 20 days and 2 deviations. And lower ATR value above the lower BB. My issue is that I am having trouble with the first line. Today March 22, yahoo shows for PANW the upper ATR amount over the upper BB but my filter is saying that is not true. The second line to qualify the lower band appears to be working.

I should add that when I use the debug filter option and type in PANW, it is only the one line in question that does not meet the criteria. I also am not able to have all the lines draw on the chart to show me what StockFetcher says the values are and compare to Yahoo.

ATR(21)*3 + close > upper bollinger band(20,2)
and ATR(21)*3 - close > lower bollinger band(20,2)and close > 7.00
and close > weekly upper bollinger band(20,2) 26 weeks ago
and weekly average volume(30) > 3000000
and market is not otcbb
and market is not etf
and close is less than 25% below close 52 week high

Any thoughts or help? I don't know how to attach images to show my issue.

xarlor
581 posts
msg #158861
Ignore xarlor
3/22/2022 2:36:32 PM

Here is the filter you were attempting:

Fetcher[
not otcbb
not etf

draw Upper Bollinger Band(20,2)
draw Lower Bollinger Band(20,2)
draw atr(21) on plot price
draw x2 on plot price
draw x3 on plot price

set{x1,atr(21) * 3}
set{x2,x1 + close}
set{x3,x1 - close}

x2 > Upper Bollinger Band(20,2)
x3 > Lower Bollinger Band(20,2)

close > 7
close > weekly upper bollinger band(20,2) 26 weeks ago
weekly average volume(30) > 3,000,000
close is less than 25% below high 52 week close
]



However, your methodology is flawed in trying to fit ATR(21) * 3 inside Bollinger Bands. Look at the individual calculations on PANW:

Fetcher[
symlist(PANW)
not otcbb
not etf

draw Upper Bollinger Band(20,2)
draw Lower Bollinger Band(20,2)
draw x1 on plot price
draw x2 on plot price
draw x3 on plot price

set{x1,atr(21) * 3}
set{x2,x1 + close}
set{x3,x1 - close}

add column separator
add column x1
add column separator
add column x2
set{UBB,Upper Bollinger Band(20,2)}
add column UBB
add column separator
add column x3
add column Lower Bollinger Band(20,2) {LBB}

/*
x2 > Upper Bollinger Band(20,2)
x3 > Lower Bollinger Band(20,2)

close > 7
close > weekly upper bollinger band(20,2) 26 weeks ago
weekly average volume(30) > 3,000,000
close is less than 25% below high 52 week close
*/
]



nibor100
1,031 posts
msg #158862
Ignore nibor100
3/22/2022 2:38:20 PM

You are probably going to have create a couple of variables using SF's Set command as you have to many math operations in your first line.

Try adding these 4 lines to the end of your filter so you can get an idea of what your issue is:

apply to symlist(panw,tsla)
add column ATR(21)*3 + close
add column 3 multiplied by ATR(21)
add column close plus 3 multiplied by ATR(21)

Ed S.



StockFetcher Forums · General Discussion · ATR above BB issue<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.