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.

scanning for first time results

I have created the following scan, to search for stocks hitting a new 6 month chande trend meter high.

[country is us] and [[exchange is not otcmkt] and [exchange is not OTCBB]] and [market cap > 300] and [group is not etf] and [close > 2]
and [close < 80]
and [chande trend meter = max(120, chande trend meter)]

If I run this scan, I will see some of the same stocks over and over, for example, as a stock keeps hitting a new high each day for a week.
Is there a way to scan for equities that hit a new high for the very first time, i.e. only shows up in the results if it did not also hit that high yesterday?

Sorry, if I am not explaining the scenario well. I suspect this can not be done, as I haven't found an IF function.

Thank you!

Comments

  • markdmarkd ✭✭✭
    edited December 2017
    You could add a test for past values of CTM.

    A simple test would be

    and [1 day ago Chande Trend Meter < 1 day ago max(120, Chande Trend Meter)]

    But if the line is wavy, you would still get the duplicate problem, just not quite as often.

  • markdmarkd ✭✭✭
    So, it turns out you can apply Price Channels to Chande Trend Meter, both on the chart and in the scan engine.

    So, on the chart, in the advanced option section for Chande Trend Meter, select Price Channels and enter 120.

    For the scan, to get an upper channel crossover you would write

    // optional line - CTM has been in a down trend
    and [Upper Price Chan(120, Chande Trend Meter) < 50]

    // upper price channel has been flat recently, meaning CTM has been below a peak
    and [5 days ago Upper Price Chan(120, Chande Trend Meter) = 20 days ago Upper Price Chan(120, Chande Trend Meter)]

    // today's CTM crosses above the Upper Price Chan for CTM
    and [Chande Trend Meter x Upper Price Chan(120, Chande Trend Meter)]

    This should get around the repeated hits problem (although you might get some for a few days) because a crossover is a one time event (within the parameters you specify).

    You might want to play with the parameters. It seems that getting back to a previous CTM peak (the upper price channel) is sometimes the start of a decline (especially in the green area) but sometimes a long advance. I thought the optional condition (crossover in the yellow section) would get some stocks just starting to climb. Needs more research, but thought it might help you with your thinking.
  • Thanks markd,
    I really like the application of price channels to the CTM, especially the cross above upper channel. I think I will apply it to the weekly and/or monthly charts instead of the daily.

    Thank you once again for your insights!
    Merry Christmas.
  • markdmarkd ✭✭✭
    Great!

    CTM seems to be about crossing into or out of the red, yellow and green zones, so you could try scans for cross above/below those trigger levels as well. Price Channels adds an additional time element to the analysis. I'm not sure if it improves the timing of entries but it's worth looking at.

    Merry Christmas!
Sign In or Register to comment.