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.
Is there a way to get the current price (last price) for a scan?
I'm building a scanning script that basically says,
a) is today's high higher than yesterday's high?
b) was yesterday's close below the Ichimoku tenkansen/conversion line but today's is above?
c) was the price higher around 5-9 days in the past (showing that there's been a pullback that is probably recovering)
I get some useful results, but also get a bunch of stocks that spiked way up (so "today's high" is higher than yesterday's close), but then the stock crashed down 5%. I want to find a way to get the current price, or the 30 minute high, or something that isn't just the open, close, high or low. Can anyone point me in the right direction?
0
Comments
That said, here is what you are asking for, as outlined above:
// begin
[group is sp600] // or whatever you want
// this is a)
and [high > 1 day ago high]
// this is b) - I don't use Ichi, so I'm guessing there
and [1 day ago close < 1 days ago Ichimoku Conversion Line(9,26,52)]
and [close > Ichimoku Conversion Line(9,26,52)]
// this is one possibility for c) - you said price - price is not a scan term so I assume you mean high.
and [5 days ago max(4,high) > high]
// end
After you see the results, you can mess with parameters and offsets to see if it helps. Also run for some back dates to see how results vary over time. Pattern scans can get no results for a time and then dozens of results, depending on how the market is behaving. In general, you will probably tend to have more luck with symbols from the high result days, because those symbols are moving in tandem with the market and not as much against it.
p.s.
after reviewing this, line c) could also be, instead of what's there now:
and [high < Upper Price Chan(10)]
You could play with the 10 - maybe 8 or 12 or 15, etc.
There is no real scanning on anything other than "Daily" data at the minimum. 30 minute is less than a day. But if you run the scan during the trading day, the current data is the incomplete daily data at the time.
The goal is to get this to show me results with stocks that are setting up potentially, without 50% of them being something that popped up at open (making "today's open higher than yesterday's close") but then crashed through the floor. It would be nice if we could reference a price other than open/close/high/low, like "last 30 minute candle's high" or something. If that's a thing.
[ChartList is 5] and // (the 300 or so stocks I follow)
[type = stock] AND [country is US] AND [[exchange is NYSE] OR [exchange is NASDAQ]] AND [market cap > 100] AND
//both daily and weekly are above the cloud
[[Daily Above Ichimoku Cloud is true] AND
[Weekly Above Ichimoku Cloud is true]] and
//weekly tenkansen/kijunset are in position
[weekly ichimoku Conversion Line(9,26,52) > weekly ichimoku Base Line(9,26,52) ]
and [daily high > daily Ichimoku Conversion Line(9,26,52)]
and [today's close > yesterday's close]
and [
[today's high < 10 days ago high ] or
[today's high < 9 days ago high ] or
[today's high < 8 days ago high ] or
[today's high < 7 days ago high ] or
[today's high < 6 days ago high ] or
[today's high < 5 days ago high ] or
[today's high < 4 days ago high ] //or
]
You are mixing Monthly, Weekly and the Daily requirements which also may be giving some issues. The data points during intraday periods are moving with each update of the data during the day. The Weekly paramater works best running on a week ending date. Similar to a Monthly requirement works best running the scan on a month ending date.
Not saying that you can't mix the weekly and the daily and the monthly requirements, it is just you need to be aware that the Weekly is based on the partial week if not run on a week ending date. If you change the weekly to looking at, one weeks ago weekly Ichimoku... etc, you would be getting a better indication (and probably intention) for that filter. Same with the Monthly. It's early December now and the Monthly is based on this month's data. One Months ago Monthly.... would probably better result for that filter, in my opinion.
You did very will with your nested OR statement at the end. This longhand version could be another source of variable results though. There are several ways to accomplish the same or similar results using Price Channels or Min/Max. @markd suggested using a bit of both of those, which is a sound and logic way to provide a way to play around with the variables to refine the filters to meet your needs.
The way you have it, the High can be greater than the 10 days ago High as long as it's less than the 4 days ago high. Is that your intention?
As for a price that is not open/high/low/close, you can calculate an average or some weighted division of a sum or difference of prices, - e.g.
and [open < [1 day ago low + [1 day ago range * .75 ]] // open is in lower 75% of yesterday's range
or just
and [open < 1 day ago high]
or you can get as complicated as
// open is above the average of yestserday's midpoint between high and low and midpoint between open and close
and [open > [[[[1 day ago open + 1 day ago close]*.5]] + [[1 day ago high + 1 day ago high] * .5]] * .5]
That's probably overkill, but just to show you can up with whatever you want. You could test for the high, low or close in similar fashion. Obviously, it's all experimental.
As for crashing down, you could test for today's low above some acceptable level.
and [low > [1 day ago low + [1 day ago range * .25 ]]
For a sharp drop, instead of testing highs, you could test for two locations of Fast Stoch %K. Fast K tells you where the current price is in the range of some number of bars. The second parameter should be 1. So,
and [10 days ago Fast Stoch %K(10,1) > 80] // ten days ago, price was in the top 20 per cent of the prior 10 day range
and [Fast Stoch %K(10,1) < 20] // today's close is in the bottom 20% of the last 10 days range.
Imkwin, yes I am mixing daily and monthly intentionally. The idea is just to only find things that have the moving averages where I want them on both the daily and weekly timeframe, to help filter out stuff I wouldn't want to invest in.
https://help.stockcharts.com/charts-and-tools/other-charting-tools/galleryview
You can even view two symbols, side by side, in Gallery View.
I have certain preferred chartstyles that I created to use as defaults. I may want to look at a Daily chart, an intraday chart, a weekly chart, or a PnF chart. For ease of use, I name my preferred weekly chart, GalleryWeekly. My preferred daily chart I named GalleryDaily. Intraday chart? GalleryIntraday. And my favorite chart, the PnF chart, has "my" default chartstyle.
About half way down the page on the above link is where they discuss "Customizing Gallery View". There are certain restrictions that apply, but it's a way to use a multi period view of a symbol(s) in SharpCharts.
For those that don't appreciate ACP's multi panel options, GalleryView is a good option.