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.

scan for a rising channel - is this hard to do?

i would like to create a scan for a rising channel where price is just above the 40 day moving average but not more than 5% above it.
is that possible?

Comments

  • I don't think you need the channel for the scan:

    [group is sp500]
    and [sma(40,close) > 21 days ago sma(40,close)]
    and [close > sma(40,close)]
    and [close < sma(40, close)*1.05]

    You can alter the 21 days to fit the situations you are looking for.
  • MARKD, thanks, i think the difference is that with a rising channel...it implies that the stock price is moving up whereas with the current scan the chart could look flat or even negatively sloped.

    Is there a way to get that channel?
  • markdmarkd mod
    edited August 2015
    A channel moves up only because the MA does. If you want something rising over a longer period of time, choose a longer MA and extend the look back period, so maybe

    and [sma(251,close) > 63 days ago sma(251, close)]
    and [sma(40, close) > sma(251,close)]

    The parameters are just suggestions. Add this code to existing code, right under [group is sp500]. To be absolutely sure of a rising trend, you could sample several look backs of the long sma - maybe 21, 63, 126, etc.

    You could also do it with stochastics - again choose a long time frame and test for %K > 70 and %K > maybe 3 months ago or six months ago.
  • DEAR mard thank you i will try it out now and give feedback
  • markd, actually i just tried it out and it seems to work well, in that it picks stocks which are in rising channels...
    However, the move seems to be advanced. The scan that you suggested picked 6 stocks.....

    take HSP, PLL, and RAI respectively......if you notice that the uptrends began in MARCH 2014 ish for all three.
    Is there a way to modify youre scan, so that it will give me stocks that have just entered the uptrends rather than already been in them for ages?

    Mark
  • take a company like BLOX as an example...how would one have caught the rising channel in OCT/NOV 2014?
  • One way would be to test for an intermediate term MA turning up. So the MA is higher than it was some short period ago, but still less than some longer period.

    So,

    and [sma(63, close) > 10 days ago sma(63,close)]
    and [sma(63, close) > 30 days ago sma(63,close)]

    You could play with both the length of the sma and the gap for the test period.

    Note that not every turn of an sma results in an extended trend.
  • Sorry, should be:

    and [sma(63, close) > 10 days ago sma(63,close)]
    and [sma(63, close) < 30 days ago sma(63,close)]
Sign In or Register to comment.