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 PctChange over a time frame

Can anyone help me?

I am trying to do a scan for X% increase at any time over a larger time frame

So say a stock that went up 400% at any time over the last 2500 days even if has fallen 50% since then

I am just looking for stocks that have had big run ups, thinking they maybe avble to do it again.

so this
[PctChange(500,close) > 300]
gives me the increase but just for last 500 days

I want that type of increase over any 500 day time period in the last 2000 days.

I tried adding the [min 2000] clause but obviously I'm doing something wrong.

I can do it by changing data and rescanning I guess or change dates in calendar, but just want to run it once .


Thanks,Neil

Answers

  • lmkwinlmkwin ✭✭
    edited December 2022
    I believe the 'max' value you can use on any parameter is 600. So 600 days, or 600 weeks or 600 months would be the max. I believe that the maximum data lookback is 10 years for many things

    600 days is approximately 2.4 years. 600 weeks is approximately 11.5 years. 600 months is 50 years

    You'd have to use a weekly parameter to get back to where you are looking for 2500 days. 2500 days is approximately 500 weeks.

    So you would just modify the code

    [weekly PctChange(500,weekly close) > 300]

    You could even use that in a Rank By statement at the end of the scan code to sort the results and display the values

    Rank By [weekly PctChange(500,weekly close)]

    I do like your 'if it hasn't done it before' thinking.
  • Price channels don't depend on the close, so the highest and lowest prices are "persistent", more or less, for the length of the channel. So you would scan for the upper channel greater than x times the lower channel. Naturally, it won't be perfect, but a few fish should come up with the seaweed.

    For instance:

    and [weekly Price Upper Price Chan(x) > weekly Lower Price Chan(x) * 3]

    So if the lower price channel is 10, the upper price channel would be 30 or more.

    You would want a price channel parameter that is considerably longer than the look back period you are actually interested in (so, if you want five years back, use eight or nine) because the channel set earlier will start moving up before the channel set later (e.g. if the channel length is five the low was set six years ago and the high two years ago, the lower channel will be moving up already, making for a narrower channel that might cause the scan to pass it by).

    I'm not sure your strategy (big run ups predict more big run ups) is valid. It can be true of some stocks in some industries - e.g. biotech, pharma, defense come to mind - new drug approvals, new weapons contracts, etc. Sometimes tech. But often, stocks with big run ups are story stocks that collapse and never come back. If they are legit, they tend to get acquired and go off the market. Basic Materials, oil, gold, coal, steel are exceptions - they fluctuate with the price of their product. Also, marine transportation is a boom or bust industry. For any of these, it can be a long wait.
  • Maybe I'm not being clear
    if I do

    [type is stock]
    and [country is us]
    and [group is not etf]
    and [close > 10]
    and[weekly PctChange(500,weekly close) > 1000]
    Rank By [weekly PctChange(500,weekly close)]

    I get 66 stocks that have increased by 1000% to date from 500 weeks ago

    but how do i find any stock that has gone up 1000% at any time at all in those 500 weeks

    like WW from 2015-2018
    SM and AR over the last 2 years
    Lxu 2020-2022
    all were up 1000% at one point but are actually down over that whole 500 week period.


    This may be kind of pointless but I just want to see what happens to stocks after big run ups.
    What they looked like before their run ups.
    and how long they took to recover and resume their run ups if they did resume.



  • maybe a max might work?

    I tried to roll the periods back using the offset of 'x weeks ago'

    I had to change the 500 to 400 to get results in the 1st try but I didn't play around with it at all. Just changed the large number to the next smaller large number.

    //to roll the period back
    and [100 weeks ago weekly max(100,PctChange(400,weekly close)) > 1000]

    I had to change the 400 to 200 to get results in the 2nd try. Once again, didn't try other numbers, just found one that worked.

    //to roll the period back further
    and [300 weeks ago weekly max(100,PctChange(200,weekly close)) > 1000]

    In the 1st try I changed the rank by to Rank By [500 weeks ago weekly close] to show what price could have been when the run started. Of course it's just a guess as to what the price was. To find the beginning price you'd need to find the point where it crossed the threshold and then divide that price by 11. I think you'll be looking at low priced stocks.

    To get the threshold to show on a weekly chart you can put the Price Performance with a parameter of $Symbol and put the ROC with a parameter of 500. For both add a Horizontal Line overlay of 1000.

    After you've saved your results to a chartlist, you can apply this chartstyle to the chartlist.

  • markdmarkd mod
    edited December 2022
    Well, let me repeat:

    if you scan using close, you will get results based only on the specified close.

    if you scan using channels, you will get results based on any high or low within the the channel length, regardless of when they were made, which is what I think you are looking for.

    p.s. - note the upper channel is the max and the lower channel is the min for the time period selected. The percent difference between low and high can be specified by requiring the upper channel to be a multiple of the lower channel (e.g., 10x = 1000%). One thing the simple channel scan won't look for is which came first, the best high or the best low, but given the market over the look back period, most will be low first.

    This gets 270 hits on 12/5

    [exchange is NYSE]
    and [type is stock]
    and [group is not ETF]

    and [ weekly Upper Price Chan(300) > weekly Lower Price Chan(300) *10]

    Display results on a 10 year weekly chart with Price Channels (300). Some results have not traded 10 years so the chart is not filled, or they have not traded 300 weeks either, so there are no channels plotted. But if you sift through, there are many that seem to fit your requirements, if I understand them correctly.
Sign In or Register to comment.