moonriding 5 posts msg #157592 - Ignore moonriding |
9/17/2021 9:18:38 AM
How do I write a filter for the following condition:
(Close – Low) / (High – Low) is equal to or less than 0.25
[note: 0.25 is 25% expressed in decimal format]
|
xarlor 587 posts msg #157593 - Ignore xarlor |
9/17/2021 9:50:37 AM
|
moonriding 5 posts msg #157634 - Ignore moonriding |
9/23/2021 8:15:30 AM
Thank you. I realize the condition I want to create is in the Example Filters "Close in bottom 25% of day range":
Open is below the Day Position(0.25,5)
What I don't understand is why the example used "Open is below" instead of "close is below".
Quoted from the Usage Guide, the Day Range equation is essentially the equation I wanted to use but rearranged: "The Day Position is a basic measure that computes a value that is a percentage of the day range. In other words, if the position parameter is 0.5, the Day Position will be Low + ((High - Low) * 0.5). Any value from 0 to 1 may be used to locate a position within the daily range."
When rearranged and only looking for close in bottom 25% of current day range I got:
Close is below the Day Position(0.25)
Please explain
|
styliten 303 posts msg #157635 - Ignore styliten modified |
9/23/2021 8:37:35 AM
@moonriding
1. Open, Close, High & Low are reversed words referring to these 4 specific values.
cf. Indicators and Measures · Open, High, Low, Close
2. When you write open/close is below/above day position(0.25), SF will check specific open or close values to see if they meet the criteria "below/above day position(0.25)".
3. Also day position(0.25) = day position(0.25, 5) because by default, the second argument, when omitted, is 5.
cf. Indicators and Measures · Day Position
Note: By default the day position period is 5 days.
which is illustrated in example 1 there, immediately below this note.
|
moonriding 5 posts msg #157637 - Ignore moonriding |
9/23/2021 9:07:39 AM
@styliten
Thank you. I want the filter to show stocks that closed in the bottom 25% of the current day's range. Is this condition correct:
close is below day position(0.25, 1)
|
styliten 303 posts msg #157638 - Ignore styliten modified |
9/23/2021 9:24:24 AM
@ moonriding
YES, and close < day position(0.25, 1) would work as well.
By extension, close < day position(0.25, 1) 1 day ago will catch those below 25 percentile of yesterday's day range and
count(close < day position(0.25, 1), 10) > 3 will catch all those that have closed below the 25 percentile mark of the daily trading range at least 3 times in the last 10 trading days (inclusive of today).
|
nibor100 1,046 posts msg #157640 - Ignore nibor100 |
9/23/2021 9:26:54 AM
@moonriding,
1. Looks like you have found a SF error in that Example you posted as I agree it should state "close" instead of "open".
Hopefully SF support will see your post and correct that example....
2. I suspect you'll find when you use the corrected statement as your filter and compare the results to Xarlor's suggested filter, that Xarlor's filter will return many more stocks than the corrected statement filter.
My initial investigation into that difference in results seems to indicate that SF is doing some kind of rounding on some of the calculations.....but who knows for sure
Hope this helps some,
Ed S.
|