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 candlesticks with small bodies

in Scanning
Hello everyone!
Long time since I've posted. I'm trying to create a scan that looks for candlesticks where the body only compromises 30% or less of the total trading range for that day. I thought I had the scan written correctly, but I am getting non-sensical results. Does someone feel like taking a gander at the code:
// Absolute value open / close range is less than 30% trading range
and [ AbsVal (today close - today open) < [ [today high - today low] * .3] ]
and [ AbsVal (yesterday close - yesterday open) < [ [yesterday high - yesterday low] * .3] ]
and [ AbsVal (2 days ago close - 2 days ago open) < [ [2 days ago high - 2 days ago low] * .3] ]
Any help would be appreciated. Thanks!
Long time since I've posted. I'm trying to create a scan that looks for candlesticks where the body only compromises 30% or less of the total trading range for that day. I thought I had the scan written correctly, but I am getting non-sensical results. Does someone feel like taking a gander at the code:
// Absolute value open / close range is less than 30% trading range
and [ AbsVal (today close - today open) < [ [today high - today low] * .3] ]
and [ AbsVal (yesterday close - yesterday open) < [ [yesterday high - yesterday low] * .3] ]
and [ AbsVal (2 days ago close - 2 days ago open) < [ [2 days ago high - 2 days ago low] * .3] ]
Any help would be appreciated. Thanks!
0
Comments
-
The first statement works correctly. The next two pass syntax but don't return the expected results.
It appears that the AbsVal() function is ignoring the "yesterday" and the "2 days ago" modifiers, so that the results getting returned come from a comparison of the difference between today's open and close and yesterday's and 2 day ago's high and low.
The way around this is to write 'or' statements that account for the possibility of a positive or negative or zero result from close - open, and then comparing the high and low. Watch your brackets.
and
[ // day one
[ // positive, zero
[ close - open >= 0]
and [close - open < range * .3 ]
] // end positive, zero
or
[ // negative
[close - open < 0]
and [ [close - open] * [-1] < range * .3]
] // end negative
] // end day one
and
[ // day two
[ // positive, zero
[ 1 day ago close - ... etc.0 -
Ah, forgot about the range function. That really helps. Thanks!0
Categories
- All Categories
- 2.3K StockCharts
- 395 SharpCharts
- 146 Other Charting Tools
- 69 Saved Charts and ChartLists
- 1.5K Scanning
- 73 Data Issues
- 177 Other StockCharts Questions
- 218 Technical Analysis
- 155 Using Technical Analysis
- 2 InterMarket and International
- 19 Market and Breadth Indicators
- 42 Market Analysis
- 109 Trading
- 109 Trading Strategies
- 163 S.C.A.N the StockCharts Answer Network forum
- 65 Using this StockCharts Answer Network forum
- 98 s.c.a.n. archives
- 5 Off-Topic
- 6 The Cogitation & Rumination Emporium
- Forum Test Area