StockFetcher Forums · General Discussion · Close above two different lines together << >>Post Follow-up
zaq777
19 posts
msg #122372
Ignore zaq777
modified
12/26/2014 1:21:09 PM

Suppose you want to know when a close is--- for the first time in awhile---above two (or more) different lines that are independent from each other?

For example a close can be above the upper Bollinger band any number of times before it moves above the EMA(150) or it can be the other way around ---- above the upper Bollinger band any number of times before the EMA(150).

But not together until today.

How do I write that?

four
5,087 posts
msg #122373
Ignore four
modified
12/26/2014 1:44:06 PM

Here are two ideas working with "something like" you are looking for:

set{x, count(close > upper bollinger band(20,1),10)}
x = 0
draw upper bollinger band(20,1)
close crossed above ema(150)
sp500

/*Today close above both MAs*/
close > ma(21)
close > ma(100)
/*Close below both MAs for the last 10 of 11 days*/
count(close < ma(21),11) > 9
count(close < ma(100),11) > 9
volume > 123123
low > 11

mahkoh
1,064 posts
msg #122374
Ignore mahkoh
12/26/2014 5:32:55 PM

Fetcher[
set{x,count(close above ma(150),1)}
set{x1,count(close above upper bollinger band(20,2),1)}
set{x2,x + x1}
set{x3,count(x2 below 1.5,20)}
x2 above 1.5
x3 above 18
]

 zaq77719 postsmsg #122375- Ignore zaq777modified 12/27/2014 5:18:18 PMYes that seems to work. Thanks. Too bad the user guide does such a poor job of explaining how to use the "set" feature or even what it is. I'm can't make any sense of it. Maybe it's just me.
mahkoh
1,064 posts
msg #122380
Ignore mahkoh
12/28/2014 12:31:57 PM

What I did when I started using SF was studying other people's filters and find out what the syntax exactly does. Even today I occasionally browse the forum to look up some code.

There are lots of useful snippets to be copied from filters published by TRO, Chetron and Kevin to name a few.

four
5,087 posts
msg #142423
Ignore four
2/23/2018 3:17:23 PM

pop

 StockFetcher Forums · General Discussion · Close above two different lines together << >>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.