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.
Hello, I'm wondering why my below daily scan did not pick up CVX or TXN today? Those were two charts I would want this scan to pick up? Any help please?
[type is stock] and [sma(20,volume) > 200000] and [Close > 5] and [region is NorthAmerica]
and [weekly Volume > 2,999,999]
and [[daily Hammer is true]
or [daily Gravestone Doji is true]
or [daily Dragonfly Doji is true]
or [daily Hanging Man is true]
or [daily Shooting Star is true]]
0
Comments
To test this, make a list that includes TXN and CVX. Then run a simple scan against that list for each candle type only (no volume, etc. conditions), one at a time. If you get no hits, then it's likely the candles on the charts don't match the criteria. You could double check by including in the list some symbols that you know DO match each candle type. If the known candles are hits, but CVX and TXN are not, that would be definitive that CVX and TXN don't match the candle type.
Here's a couple of links to the documentation on the specifics of candlestick patterns.
https://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:introduction_to_candlesticks#dragonfly_doji
https://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:candlestick_pattern_dictionary
If you wanted to broaden the definition of any particular candlestick you could always write your own code. For example a Doji forms when a security's open and close are virtually equal, I'm sure StockCharts uses a very small tolerance on this, say 0.1%. But you could expand this to be, the open and close should be within say 0.5%
[[1 day ago Open > 2] and [1 day ago Close < 2]]
and [favorites list is 16] // TEST
https://stockcharts.com/def/servlet/SC.scan
// doji scan
[favorites list is ...]
and [daily Hammer is true]
// end doji scan
Then try each of the other candle types you are looking for. I'm guessing you will get no results because CVX and TXN probably don't fit the exact requirements for the Stockcharts definitions.
If you want to try your own definition, it's a little complicated. Part of the definition of a doji depends on whether it is making higher prices in an up leg, or lower prices in a down leg. But, since you are looking for any kind of doji, you could concentrate on just getting a very small body.
To do that, you would compare the distance between the open and close (the body) to the distance between the high and the low (the range of the whole bar):
and [ [close - open]/[high - low] < ... ]
The problem is, if you just write the scan this way the difference [close - open] is negative if the open is above the close, and comparing a negative value for the body to a positive value for the range won't give you a reliable result. You need a positive number for the body.
There is a function called absval( ), but it only works for indicators with a negative value. It doesn't work with operations like subtraction.
So, you have to write the scan to get a positive number for both situations - close above open or open above close.
// begin narrow body scan
[favorites list is ...] // your list
and
[
// close is above open
[
[ close > open]
and [ [close - open] < [high - low]*0.2] // body less than 20% of range, or use .1 (10%), .05 (5%), .01 (1%), etc.
]
or
// open is above close
[
[open > close]
and [ [open - close] < [high-low]*0.2]
]
or
[ close = open ] // rare, but could happen
]
// end narrow body scan
Hint: don't type in "[favorites list is ...]. Instead, select the list from the ChartLists dropdown and cut and paste it to the TOP of the scan. Also, be careful with the brackets. Don't leave any out.