siliconhippy 37 posts msg #34282 - Ignore siliconhippy |
12/8/2004 11:47:00 PM
Does anyone know how to construct the equivalent of a non-decreasing (or a non-increasing) phrase, perhaps with sensitivity (e.g. within 3%)
I am looking to construct a phrase where I would like to specify ema(10) minus ema(50) as non-decreasing over the last 45 days, within a 3% margin. This eliminates the cases where the diff is going down, but preserves cases where the general trend is still roughly up or neutral, i.e. ignores minor whipsaws.
I wonder if SF can create such a feature, and more usefully, create a "negative" phrase that can be applied to attributes like "increasing" or "decresaing."
siliconhippy
|
TheRumpledOne 6,411 posts msg #34285 - Ignore TheRumpledOne |
12/9/2004 12:22:05 AM
Does anyone know how to construct the equivalent of a non-decreasing (or a non-increasing) phrase, perhaps with sensitivity (e.g. within 3%)
I am looking to construct a phrase where I would like to specify ema(10) minus ema(50) as non-decreasing over the last 45 days, within a 3% margin. This eliminates the cases where the diff is going down, but preserves cases where the general trend is still roughly up or neutral, i.e. ignores minor whipsaws.
I wonder if SF can create such a feature, and more usefully, create a "negative" phrase that can be applied to attributes like "increasing" or "decresaing."
siliconhippy
This may help.
MAY ALL YOUR FILLS BE COMPLETE.
|
cegis 235 posts msg #34290 - Ignore cegis |
12/9/2004 11:19:03 AM
The RumpledOne's suggestion does not give the 3% range, tho.
Maybe this will do it:
The first line calculates the ema difference today.
The second line calculates it for yesterday.
The third line adds 3% to today's ema difference.
Within the count() function, the subtraction calculates the day-to-day change in the difference, but adding the extra 3%. If this number is consistently above zero, then you have a positive trend, within the 3%. The count() function, then, is seeing how many times over the past 45 days the calculation is above zero. Then, the comparison of the count() to 45 means that ALL 45 days have to be in the positive trend. (In this case, you could also use days(), but you'd have to look for days(d0b minus d1 is less than 0,45) to see when it was last below zero.) You could "loosen" your criteria by looking for cnt > 40, say.
HTH,
C
P.S., Didn't mean to show you up, Avery :-)
|
siliconhippy 37 posts msg #34295 - Ignore siliconhippy |
12/9/2004 3:28:13 PM
Thanks, RumpledOne and cegis.
You guys keep SF what it is meant to be.
siliconhippy
|
TheRumpledOne 6,411 posts msg #34369 - Ignore TheRumpledOne |
12/15/2004 12:28:05 AM
Cegis:
I didn't want to write the whole filter... just wanted to point the guy in the right direction.
I LOVE YOU MAN!
|