StockFetcher Forums · General Discussion · Need help to show fewer buy signals<< 1 2 >>Post Follow-up
JoeyVinyl
125 posts
msg #150878
Ignore JoeyVinyl
2/23/2020 5:01:06 PM

In testing out different ideas, I created a filter to show a buy signal when the Linear Regression Slope number was higher than it was two days ago, and a sell signal when it had been dropping for two days. I'm not concerned with it being above or below zero. I just want to know when it starts going up or down.

I haven't paper traded it yet so I don't know if it's a profitable filter, but it does exactly what I asked it to do. The problem is that I get too many buy and sell signals below the chart. I'd like to see just one for the first time the condition is met, not one for every day. If this were a spreadsheet I'd just make an IF-THEN statement, but SF doesn't use those. I don't actually need fewer signals. The full filter only gave me 26 hits today and it's easy enough to just look at the charts, but I think the charts would be more aesthetically pleasing if they were less cluttered. This is more of an "if you have the time and want to play with this" kind of request than an "I desperately need help to make this work!" request.

Here is just the snippet of code I'm using to create the signals, not the entire filter. To recap, I'd like to see a signal on only the first time the LRS moved up or down two days in a row.

Fetcher[set {buy, count(linear regression(20) slope > linear regression(20) slope 2 days ago,1)}
set {sell, count(linear regression(20) slope < linear regression(20) slope 2 days ago,1)}

Show stocks where close is between 3 and 20
draw buy
draw sell
draw linear regression(20) slope
add column separator
add column buy
add column sell
]




xarlor
561 posts
msg #150879
Ignore xarlor
2/23/2020 5:42:58 PM

Here you go!

Fetcher[
set{buy1,count(LRS(20) > LRS(20) 2 days ago,1)}
set{buy2,count(LRS(20) 1 day ago < LRS(20) 3 days ago,1)}
set{buy,buy1 * buy2}
buy > -1
set{sell1, count(LRS(20) < LRS(20) 2 days ago,1)}
set{sell2, count(LRS(20) 1 day ago > LRS(20) 3 days ago,1)}
set{sell,sell1 * sell2}
sell > -1

Show stocks where close is between 3 and 20
draw LRS(20)
add column separator
add column buy
add column sell
]



JoeyVinyl
125 posts
msg #150886
Ignore JoeyVinyl
2/24/2020 7:18:56 AM

@xarlor

Awesome! I knew I had to make two different buy and sell set statements and combine them somehow, but I couldn't figure out what the second one should be. Thank you!

karennma
8,057 posts
msg #150891
Ignore karennma
modified
2/24/2020 11:59:07 AM

That's a good filter.
Since I'm not a filter writer, maybe you can answer this question ...
How would the filter be rewritten so that 90% of your results would be sells?

(The 10% left would be short ETFs which would give you a long signal.)

JoeyVinyl
125 posts
msg #150897
Ignore JoeyVinyl
2/24/2020 4:31:33 PM

@karennma

There's a lot about writing filters here that I still don't know, so I'm not sure how that would be done. I tried just taking out the buy signals but that won't give you the ETF charts. I have "market is OTCBB" and "market is not ETF" as my global filter; you won't see them in any filters I post here so if you click on either filter here it will show you ETF's. Like I said in my OP, this isn't even the full filter. It's just the parts to get the signals with the "close > 3" to get it working as a filter. I do that so that people can easily add whatever indicators they like, or filter phrases. You're welcome to take it and build on it if you want.

Cheese and Xarlor have been the most helpful to me with filter coding. Perhaps one of them could help.

Cheese
1,374 posts
msg #150899
Ignore Cheese
2/24/2020 5:02:48 PM

I don't know how much help I could be here.
karennma and xarlor know a lot more about trading than I do.

Also, i am not sure I've understood karennma's request.
If the goal is to get stock picks to sell, then one place to start may be with
Guppy emas (graftonian and Mactheriverrat)
or Guppy T3 (sandjco)
or Village Elder roc(5,1)

For buy and sell in general,
many public chart lists on stockcharts.com use rsi(14) and macd(12,26,9).

One of my favorite public chart lists is by Joanne Klein

HTH


karennma
8,057 posts
msg #150901
Ignore karennma
modified
2/24/2020 7:53:04 PM

@ Cheese,
OMG!
Look what I missed!

Fetcher[
draw roc(5,1)
apply symlist(roku)
roc(5,1) < -4.00
add column roc(5,1)
]



Look at the candle!
Geesh!
The vultures grabbed that quick!
Futures are up too.
Today was a one-day wonder.



karennma
8,057 posts
msg #150902
Ignore karennma
2/24/2020 8:09:07 PM

Just looked at the ROKU chart.
The vultures bot it @ $109 afterhours.

Cheese
1,374 posts
msg #150903
Ignore Cheese
2/24/2020 8:14:37 PM

Yes, I missed some dip buying ops, too.
My bias was that the decline was too steep and a V-shape recovery would be unstable
Convential trading wisdom is to wait for higher low and higher high
Oh well
WDIK

Cheese
1,374 posts
msg #150904
Ignore Cheese
2/24/2020 8:26:31 PM

In my untrained eyes, if ROKU could bounce off around 99.45 that may look like a triple bottom.

StockFetcher Forums · General Discussion · Need help to show fewer buy signals<< 1 2 >>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.