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.
Options

About the intermediate-term price consolidation


I have read the help support about the scan on price consolidation

//Intermediate-term price consolidation
and [max(20,close) <= SMA(20,close) * 1.02]
and [min(20,close) >= SMA(20,close) * 0.98]

I adopt by changing to 60 days manages to look for a observable consolidation/side-way pattern. However, the result is not good. I don't see it is a meaningful consolidation. Are there any better ways?

and [max(60,close) <= SMA(60,close) * 1.02]
and [min(60,close) >= SMA(60,close) * 0.98]


P.S I don't know how to attach the chart as an example.




Comments

  • Options
    lmkwinlmkwin ✭✭
    edited June 2023
    This scan filter is looking for securities that are max and the min close price for the last 60 days is within 2% of the current moving average. This would show a longer term consolidation. or sideways action.

    The maximum close price in the last 60 days is less than or equal to 2% above the current 60 SMA.
    The minimum close price in the last 60 days is great than or equal to 2% below the current 60 SMA.

    I don't want to say that is will provide a bunch of boring stocks, but there shouldn't be many securities that AREN'T in the result. You are asking for the last 60 days price to be in a +/- 2% range of the current moving average. Only a security with little volatility will meet that requirement.

    The original scan filter was using 20 days. This is about a month time. 60 days is about 3 months time.

    Using the original scan, you can see how the min and the max price requirement looks on a chart by adding a SMA Envelope on the chart with the parameter of 20,2

    This is a 3 month chart with one of the results from the orignal scan filter of 20. I marked the approximate 20 day point that the min/max close information is used.




    To put a chart into your post there are a couple ways. The easiest is to right click on the chart and Copy and then Paste into the comment section. It will add it as a line of code. To see the post, click the Preview button at the bottom of the post.

  • Options
    Another way to test for prices in a range would be to use price channels.

    If price hasn't broken out of the channel, and the channel period has not expired, the channels will be flat. So today's channel value will be equal to the channel value some number of periods ago (if the number is less than the channel period).

    So, to test for a 60 day consolidation, you might test for say 75 day flat channels.

    and [Upper Price Chan(75) = 60 days ago Upper Price Chan(75)]
    and [Lower Price Chan(75) = 60 days ago Lower Price Chan(75)]

    I'm guessing at the Chan parameter. Maybe 90 or 100 would be better.

    You could also test for the distance between the channels to see if that helps - for instance, the upper channel is less than 1.25 times the lower channel i.e. 25% above - e.g. if the lower price chan is 12, the upper price chan is less than 12*1.25 = 15

    and [Upper Price Chan(75) < Lower Price Chan(75) * 1.25]
  • Options
    Thanks markd , lmkwin for the details and useful feedback.
  • Options
    I think it over.

    "and [Upper Price Chan(75) = 60 days ago Upper Price Chan(75)]"
    Why don't you set the channel equal to the consolidation period? ie. chan(60) instead of chan(75) ?

    "and [Upper Price Chan(75) < Lower Price Chan(75) * 1.25]"
    Should it be :
    and [Upper Price Chan(75) =< Lower Price Chan(75) * 1.25] ? If you want upper and low channel be [15,12]
  • Options
    Why don't you set the channel equal to the consolidation period?

    You could. Try it. But, that condition would be true for just one bar. Before that condition is true, the length of flat channel will be less than its parameter, and one bar after the channel will tick up or down, so it won't be flat anymore.

    Should it be...

    It can be anything you want that gets results you are looking for. You have to experiment. I was just guessing/estimating what MIGHT work.
  • Options
    Thanks markd I am a newbie in scan. Think everything should follow a rigid rules. I would try. Really appreciate your help.
  • Options
    lmkwinlmkwin ✭✭
    in a scan, everything is a "rigid" rule. If you say that the price has to be above the 10 day SMA, on the returned results, the price will be above the 10 day SMA.

    As you are learning to use the workbench and available tools, I admire what you are doing. Asking questions as you go. I learned using the tutorials and playing around, but really learned best from asking questions of interest to me and getting responses from the forum to better my understanding. Keep up the good work.

  • Options
    markdmarkd mod
    edited June 2023
    "Think everything should follow a rigid rule"

    I think what you may mean by this is that we should assume that the market behaves as if it had rules like the the laws of physics. Unfortunately, that's not true.

    The only real rule is that price is set by the balance of supply and demand. More money than stock for sale - prices go up. More stock than money to buy them - prices go down.

    The problem is, that balance fluctuates, and never does so in exactly the same way twice. That's because so much of trading depends on emotion - humans get bored, humans get excited. Buyers rush in, sellers panic. But how long a mood lasts varies. The weather, the time of year, news or lack of it all influence price movement. Sometimes price and volume patterns stretch out, sometimes they compress. That's why indicators sometimes work and sometimes don't. Most indicators look back over a set period of time. But a price movement may stretch out longer, or be over before the indicator can pick it up.

    So, when you are looking for a price pattern in a scan, you have to set loose limits - a range of max and min likely values. Of course that gets complicated and takes some time and experimentation to learn.

Sign In or Register to comment.