StockFetcher Forums · Filter Exchange · /* STOCKS IN LINEAR REGRESSION AND EMA UPTRENDS */ set{T10, count(...<< >>Post Follow-up
hrosas
27 posts
msg #48689
Ignore hrosas
12/17/2006 7:03:35 PM

TRO:
Some time ago you wrote this complex filter (very good indeed!). On the chart you show a TREND 111. How do you filter stocks by two parameters only:
1) When the TREND moves to 100 (or leaves 0)
2) When the TREND moves to 0 (or leaves 100)

I noticed that (generally) when the line (TREND) is on the upper level the stocks are trending up.
thank you
Hugo


TheRumpledOne
6,362 posts
msg #48690
Ignore TheRumpledOne
modified
12/17/2006 7:53:14 PM

Fetcher[
/* ENHANCED TREND DISPLAY */

set{T10, count(10 day slope of the close above 0,1)}
set{T60, count(60 day slope of the close above 0,1)}
set{T200, count(200 day slope of the close above 0,1)}

Set{a1, T200 * 1}
Set{a2, T60 * 10}
Set{a3, T10 * 100}

Set{aa, a1 + a2}
Set{TREND, aa + a3}
set{T10a,days(10 day slope of the close below 0, 100)}
set{T60a,days(60 day slope of the close below 0, 100)}
set{T200a,days(200 day slope of the close below 0, 100)}

ADD COLUMN TREND
ADD COLUMN TREND 1 day ago {T1ago}
ADD COLUMN T10a
ADD COLUMN T60a
ADD COLUMN T200a

draw T10a
draw T60a on plot t10a
draw T200a on plot t10a


/* enter your Upper Limit criteria */
set{UpperLim, High 2 week High}

/* enter your Lower Limit criteria */
set{LowerLim, Low 2 week Low}

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

set{PCT, LimDiff / LowerLim}

set{HiOp,high - open}
set{OpLo, open - low}

set{CCb,days(close is above close 1 day ago,100)}
set{CCa,days(close is below close 1 day ago,100)}
set{ClxCl, CCa - CCb}

set{VolUp, days(volume is below volume 1 day ago,100)}
set{VolDn, days(volume is above volume 1 day ago,100)}
set{VlXvl, VolUp - VolDn}

set{vck1, volume 1 day ago }
set{vck, volume / vck1 }
set{vdbl, days(vck < 2, 100)}

/* profit had you bought the open 5 days ago and sold at the high */

set{High5, High 5 day High}
set{Profit, High5 - open 5 days ago}

/* Narrow Channel Breakout Display */

set{ High20, high 20 day high}
set{ Low20, low 20 day low}

set{ New20High, count( high above High20 1 day ago , 1 ) }
set{ New20Low, count( low below Low20 1 day ago , 1 ) }

/* column display */

add column HiOp
add column OpLo
add column Profit

/* PLOTS */

draw UpperLim on plot price
draw LowerLim on plot price

and add column clxcl
and add column VlXvl
and add column Vdbl

/* Selection Criteria */

set{t1ago, trend 1 day ago}
set{t1diff, trend - t1ago}
t1diff above 0

close above 1

avg vol(5) above 500000
avg vol(30) above 500000

add column industry

Sort column 5 descending
]




"Some time ago you wrote this complex filter (very good indeed!). On the chart you show a TREND 111. How do you filter stocks by two parameters only:
1) When the TREND moves to 100 (or leaves 0)
2) When the TREND moves to 0 (or leaves 100)"

The above filter will return stocks where the trend changed.

The TREND column is in XYZ format where

X = 1 if 10 day linear regression is up, = 0 if 10 day LR is down.

Y = 1 if 60 day linear regression is up, = 0 if 60 day LR is down.

Z = 1 if 200 day linear regression is up, = 0 if 200 day LR is down.

HTH.


hrosas
27 posts
msg #48692
Ignore hrosas
12/17/2006 8:04:11 PM

TRO:
Thank you! But this one is even more complex.
Let me refrase: on the following filter:
/* STOCKS IN LINEAR REGRESSION AND EMA UPTRENDS */

set{T10, count(10 day slope of the close above 0,1)}
set{T60, count(60 day slope of the close above 0,1)}
set{T200, count(200 day slope of the close above 0,1)}

Set{u1, T200 * 1}
Set{u2, T60 * 10}
Set{u3, T10 * 100}

Set{uu, u1 + u2}
Set{TREND, uu + u3}

set{CCb,days(close is above close 1 day ago,100)}
set{CCa,days(close is below close 1 day ago,100)}
set{CxC, CCa - CCb}

set{E5b,days(close is above ema(5),100)}
set{E5a,days(close is below ema(5),100)}
set{CxE5, E5a - E5b}


set{E1326b,days(ema(13) above ema(26),100)}
set{E1326b1, count(E1326b above -1 , 1)}
set{E1326b2, E1326b * E1326b1}
set{E1326a,days(ema(13) below ema(26),100)}
set{E1326a1, count(E1326a above -1 , 1)}
set{E1326a2, E1326a * E1326a1}

set{E13xE26, E1326a2 - E1326b2}

set{v, volume 1 day ago}
set{volinc, volume - v}
set{volpc, volinc / v}
set{volpct, volpc * 100}

set{VolZ, days(volume < 1,100)}
set{VolUp, days(volume is below volume 1 day ago,100)}
set{VolDn, days(volume is above volume 1 day ago,100)}
set{VolCnt, VolUp - VolDn}


TREND EQUAL 111
E13XE26 ABOVE 0

CLOSE ABOVE 10

VOLUME ABOVE 1000000

ADD COLUMN RSI(2)
ADD COLUMN TREND
ADD COLUMN E13XE26
ADD COLUMN CXE5 {C_x_E5}

ADD COLUMN CXC {C_x_C}

ADD COLUMN VOLPCT {V% chg}
ADD COLUMN VOLCNT {V u/d}

SORT COLUMN 10 DESCENDING

You show a trend --- on a straight line on the upper or lower side. I would like to filter ONLY when the line changes from the low to the up side and viceversa.
Thank you!
Hugo


StockFetcher Forums · Filter Exchange · /* STOCKS IN LINEAR REGRESSION AND EMA UPTRENDS */ set{T10, count(...<< >>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