New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

Keltner; what am I missing?

I have a scan that is supposed to look for stocks that have closed above the Keltner channel anytime within the last 25 days (along with some other basic stuff). Problem is, this scan is not at all matching what other scanning services are returning. For example, KMX is an excellent setup that StockCharts doesn’t show, and I cannot figure out why it is being excluded. I am thinking the Keller line is somehow wrong, but am not sure. Any ideas?

Here is the code I’m working with:

[type is stock]

and [group is not ETF]

and [country = US]

and [EMA(20,Close) > 5] 

and [EMA(50, Volume) > 200000]

and [Max(25,close) > Upper Kelt Chan(20,2.25,10)]

and [RSI(14) >= 45.0]

and [RSI(14) <= 65.0]


  • markdmarkd mod
    edited November 2019
    Your scan is asking, is the max close in the last 25 days greater than TODAY'S Upper Kelt value. It doesn't say anything about previous Upper Kelt values. It also doesn't say anything about other closes in the last 25 days that are not the max close ( a close other than the max close might have closed above its Kelt, while the max close might be below its Kelt - for instance, if the stock dropped sharply).

    For strictly accurate results, you have to compare each of the past 25 closes to each corresponding Upper Kelt value in an "or" statement, so that if any one comparison is true you will get a hit.

    So, it would be

    // begin scan

    ... // other stuff


    [ // begin or statement

    [25 days ago close > 25 days ago Upper Kelt Chan(20,2.5,10)]


    [24 days ago close > 24 days ago Upper Kelt Chan(20,2.5,10)]



    ] // end or statement

    .... // other stuff

    // end scan
  • Thank you! I see my mistake now. It’s very annoying you can’t make within statements. This is standard with other services like StockFetcher.

  • Well, I think the scan language is deliberately kept simple so non-IT experienced users can use it. Also, the more complicated the language gets, the more support issues there are. I've found it's possible to code anything you are likely to need, but you may have to open up to a different way of looking at some problems.
Sign In or Register to comment.