StockFetcher Forums · General Discussion · Simple Syntax...stumped!<< >>Post Follow-up
mktmole
319 posts
msg #59164
Ignore mktmole
1/20/2008 5:17:46 PM

In filters I would like to plot and show the Up and Down Trend by using the "Slope" of the LR and/or the LR "Channel" as a column value, 1= yes 0 =No and having some difficulties with both types.
Any input is appreciated, Thank-you!
examples.....

set{DownTrend, Linear Regression Slope(45) has been decreasing for 45 days}
add column DownTrend

set{UpTrend, slope of Linear Regression Channel(45) is above.1}
add column UpTrend


nikoschopen
2,824 posts
msg #59166
Ignore nikoschopen
modified
1/20/2008 7:05:40 PM

Perhaps you can tell me the difference between "Linear Regression Slope(45) " and "slope of Linear Regression Channel(45)", but here's one way to get around ure problem. In the following filter, the "trend" column will spit out 1 if either DownTrend or UpTrend takes place.

Fetcher[
set{DownTrend, count(Linear Regression Slope(45) has been decreasing for 45 days,1)}
add column DownTrend

set{UpTrend, count(slope of Linear Regression Channel(45) is above 1,1)}
add column UpTrend

set{Trend, DownTrend + UpTrend}
add column Trend
]


However, not knowing whether 1 points to the UpTrend or the DownTrend leaves too much room for question. Hence, this is not a very effective filter IMHO. The following filter, on the other hand, will spit out a value of 1 for the UpTrend and -1 for the DownTrend.

Fetcher[
set{DownTrend, count(Linear Regression Slope(45) has been decreasing for 45 days,1) * -1}
set{UpTrend, count(slope of Linear Regression Channel(45) is above 1,1) * 1}
set{both, DownTrend + UpTrend}
set{Trend, 1 - count(both equals 0,1)}
Trend above 0
add column DownTrend
add column UpTrend
add column both{Trend}
]



mktmole
319 posts
msg #59168
Ignore mktmole
1/20/2008 10:50:48 PM

Niko... thanks kindly for your help and several options, was perfect!

...and no, I'm not sure of the difference when using using
"Slope" vs "Channel" of LR, but "assume" them to be near the same?

karennma
6,386 posts
msg #59172
Ignore karennma
modified
1/21/2008 8:30:47 AM

had a question, but nevermind ...
awesome!

StockFetcher Forums · General Discussion · Simple Syntax...stumped!<< >>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 2016 - 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