StockFetcher Forums · Filter Exchange · Keltner channels<< >>Post Follow-up
124 posts
msg #105019
Ignore papagatorga
2/17/2012 12:33:11 PM

On StockCharts, my platform plots Keltner channels as (20,2,0,10). I am seeking a filter that identifies crosses of the top and bottom lines. I realize that would be two different filters. Cross the top line to the upside and bottom line to downside. In other words, outside the lines. StockFetcher or anyone can you help me? Say crosses within the last 3 days.

4,372 posts
msg #105025
Ignore four
2/17/2012 3:56:31 PM

error fixed... thanks Kevin


set{abv, days(Close crossed above the Upper Keltner Band(20,2.0,10),3)}
add column abv

set{blw, days(Close crossed below the Lower Keltner Band(20,2.0,10),3)}
add column blw

draw abv
draw blw
draw Keltner Band(20,2.0,10)

volume > 12312
close > 10

4,599 posts
msg #105027
Ignore Kevin_in_GA
2/17/2012 5:04:59 PM


I think this is more like what you are asking - BTW, you had a typo in your settings, which should be (20,2.0,10).

StockCharts uses the n-day average for the ATR to determine the width of the band, and is calculated as follows:

Middle Line: 20-day exponential moving average
Upper Channel Line: 20-day EMA + (2 x ATR(10))
Lower Channel Line: 20-day EMA - (2 x ATR(10))

If you want an exact translation into SF code it is best to write this from scratch:


set{20ema, EMA(20)}
set{width, ATR(10)*2}
set{upperK, 20ema + width}
set{lowerK, 20ema - width}
draw upperK on plot price
draw lowerK on plot price

/*now find stocks that either crossed below lowerK OR above upperK*/

set{aboveKelt, count(close above upperK,1)}
set{belowKelt, count(close below lowerK,1)}
set{trigger, aboveKelt + belowKelt}

trigger above 0.5
trigger 1 day ago below 0.5
close above 1

add column trigger
add column aboveKelt
add column belowKelt

sort on column 6 descending

This is a lot of stocks, so you might want to combine this with at least one more screening criterion.

124 posts
msg #105040
Ignore papagatorga
2/18/2012 3:24:10 PM

Thank you both. Kevin it does seem to be working well. Yes there are too many results, I had not expected near that number. I cut it to a managable number for my purposes, with a volume and price filter (vol over 1,000,000 and price over 10). It reflects some very good results going back one or two weeks. Now if I could figure how to select those winners.

StockFetcher Forums · Filter Exchange · Keltner channels<< >>Post Follow-up

*** Disclaimer *** 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. does not recommend particular securities., 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 2018 - 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