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.
Would appreciate suggested code that finds "downward sloping 50 day sma for x days". Thanks
Thanks much for your help with the code for a sloping sma. Before your suggestions, I tried to use the slope command but couldn't ever get the parameters right. I need it to run a bearish PSAR routine that uses a downward sloping 50 dsma. With your help, I was able to run a scan and got 4 issues. I'll see if the scan is useful in a few days. Bill
a couple of comments - you really don't need to wait to see if the scan is useful. You can run it today for dates in the past and look at the results. Also, you need to look at many, many hits (not just four) over a wide period of time in different markets to get a feel for when it works and when it doesn't. Many set ups will work in one market but not another. Markets trending up, trending down or moving sideways produce different degrees of success (since most stocks move with the market as a whole).
Dave Landry shared a scan thought a year or so ago. A stock makes a new high and then pulls back for 2 days.
and [[3 days ago high = 3 days ago max(251,high)] and [Streak Down(high) = 2]]
So I can run this today and get today's results.
Or, I can nest in similar criteria looking back further than today by adding some additional lines.
and [ [[3 days ago high = 3 days ago max(251,high)] and [Streak Down(high) = 2]]
[[4 days ago high = 4 days ago max(251,high)] and [1 days ago Streak Down(high) = 2]]
[[5 days ago high = 5 days ago max(251,high)] and [2 days ago Streak Down(high) = 2]] ]
Of course this modified his idea to a certain extent but I could set it up as a scan or alert and capture the symbols that met the criteria for today and yesterday and the day before.
I could set up a scan to run today and capture all the symbols that met a criteria in the last 5 days, or 5 weeks or whatever.
I find this idea useful when looking at buying and selling climaxes. It's not important to know what is going on with a BC or SC the next day. And probably not the next week. I tend to start analysis of them a few weeks out from their occurrence to see there the Wyckoff activity analysis would start to take shape. So my scan would look for BC or SC that occurred a few weeks ago to create a list.
You can also run the nested scan using back dates to cast the net over those that met the criteria then as well.
and [high > 1 day ago max(251, high) ]
and [ 1 day ago max(251, high) = 50 days ago max(251, high)]
You could play with the "50 days ago" to see what happens.
Note: 1 day ago max(251, high is the same as Upper Price Chan(251) - price channels lag by one day.
Also note that new annual highs are sometime tops. Verify that other parts of the chart show strength, and the longer term weekly and monthly charts show some trendiness.
You may have a good scan for certain market conditions.
Not saying that your scan was good or not. I don't know. Just adding some color to be aware of when evaluating results.