StockFetcher Forums · Filter Exchange · filter phrase- "non-decreasing" ...<< >>Post Follow-up
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


Fetcher[set{B, days(EMA(10) is below EMA(50),100)}

B is above 44

and add column B
]



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:

Fetcher[
set{d0, ema(10) minus ema(50)}
set{d1, ema(10) 1 day ago minus ema(50) 1 day ago}
set{d0b, d0 * 1.03}

set{cnt,count(d0b minus d1 is greater than 0,45)}

cnt is equal to 45

add column d1 {Diff Yesterday}
add column d0 {Diff Today}
add column cnt {trend days}
]



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!






StockFetcher Forums · Filter Exchange · filter phrase- "non-decreasing" ...<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.