StockFetcher Forums · General Discussion · Is there an "if"<< >>Post Follow-up
starfox182
24 posts
msg #100379
Ignore starfox182
4/23/2011 6:18:31 AM

How do I make my filter to screen something like this as an example: Price 250% gain in last 14 days then price 200% loss within those 14 days?

four
5,087 posts
msg #100380
Ignore four
modified
4/23/2011 7:24:29 AM

The first ma(10) statement is a required gain and then the second ma(10) statement is a required drop.

The 'lag 11' is to go into the past by 11 days for the first requirement. Then allowing the drop to occur in the last 6 days.
Both actions occur in sequence and within 17 days (11 days + 6 days).

Notice the ma(10) line goes up and then down. I believe you are looking for this pattern.

Fetcher[

ma(10) gained more than 1.0 percent over the last 10 days lag 11
ma(10) dropped more than 0.5 percent over the last 6 days
close > open
close > 5
volume > 10000
high < ma(10)

]



Another...

Fetcher[
ma(10) gained more than 1.0 percent over the last 10 days lag 11
ma(10) dropped more than 3 percent over the last 5 days
close > open
close > 5
volume > 10000
high < ma(10)
]




starfox182
24 posts
msg #100381
Ignore starfox182
4/23/2011 7:40:37 AM

Thank you so very much!!!!! :)

TheRumpledOne
6,407 posts
msg #100420
Ignore TheRumpledOne
modified
4/25/2011 6:37:01 PM

Fetcher[
/* PRICE POSITION Display */

/* enter your Upper Limit criteria */
set{UpperLim , High14 day High}

/* enter your Lower Limit criteria */
set{LowerLim , Low 14 day Low}

set{ Dynamic_Range , UpperLim - LowerLim }
set{PPDiff, CLOSE minus LowerLim}
set{PPDiv, PPDiff / Dynamic_Range}
set{BallOn, PPDiv * 100}

set{ CUT, UpperLim / LowerLim }

add column BallOn
add column UpperLim
add column LowerLim

/* SELECTION CRITERIA */


CUT above 2.5
BallOn below 20

sort column 5 descending
]



nibor100
1,010 posts
msg #133272
Ignore nibor100
12/18/2016 12:51:45 PM

@ four

While researching past posts for how to use the "lag" expression as described in the Yepher version of the user manual I ran across this old post of yours from 2011:

"The first ma(10) statement is a required gain and then the second ma(10) statement is a required drop.

The 'lag 11' is to go into the past by 11 days for the first requirement. Then allowing the drop to occur in the last 6 days.
Both actions occur in sequence and within 17 days (11 days + 6 days).

Notice the ma(10) line goes up and then down. I believe you are looking for this pattern.

Submit Fetcher[

ma(10) gained more than 1.0 percent over the last 10 days lag 11
ma(10) dropped more than 0.5 percent over the last 6 days
close > open
close > 5
volume > 10000
high < ma(10) "

I am interpreting lag 11 to mean to go in the past 11 days which would seem to result in stocks that have a 1% gain from 21 days ago thru 11 days ago and not the aforementioned 17 days ago thru 6 days ago, or am I missing something about the first line of the above filter?

2nd question do you have any idea why my test filter below doesn't apply the 10 day lag?

rsi(2) is less than 1 lag 10
add column rsi(2) 10 days ago {ten}
add column rsi(2) 11 days ago {11}
add column rsi(2) 9 days ago {9}
add column rsi(2)

Thanks,
Ed S.


four
5,087 posts
msg #133273
Ignore four
modified
12/18/2016 2:10:15 PM

I believe what you want is accomplished with this filter (stick with "x days ago") :

rsi(2) 10 days ago is less than 1
add column rsi(2) 10 days ago {ten}
add column rsi(2) 11 days ago {11}
add column rsi(2) 9 days ago {9}
add column rsi(2)
draw rsi(2) line at 1




four
5,087 posts
msg #133274
Ignore four
12/18/2016 2:47:58 PM

Another example (working with a required range for RSI values):



nibor100
1,010 posts
msg #133287
Ignore nibor100
12/19/2016 1:05:38 PM

@four
Sorry about the confusion, I wasn't looking for filter examples regarding "X days ago", as I am familiar with using that expression.

I thought I had asked specific questions regarding the use of "lag X" as it seems to work in some filters and not in others and you had a past post using lag that still returns results.

I was hoping I could use "lag X" instead of "X days ago" in order to save future typing and to make my filters easier to read.

I appreciate the time you took to post those 2 suggested filters and I'll follow your advice to avoid using "lag X"..
Ed S.

four
5,087 posts
msg #133288
Ignore four
12/19/2016 1:12:03 PM

welcome

StockFetcher Forums · General Discussion · Is there an "if"<< >>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.