StockFetcher Forums · General Discussion · Finding stocks that trend - highly directional within a range<< 1 2 >>Post Follow-up
jcollins01
29 posts
msg #85378
Ignore jcollins01
1/1/2010 5:20:01 PM

I'm trying to figure out how to write a filter or indicator to find stocks that "tend to trend" ie. in the last 3 months , xyz went to 40, then down to 30, then back up to 40 and then down to 35 . if it just drifted between 30 and 40 , or went to 40 from 30 or to 30 from 40 Im not interested in it (lower score). Example stocks are APA and CSX , both very directional and tradeable.

Eman93
4,750 posts
msg #85387
Ignore Eman93
modified
1/1/2010 8:13:13 PM

Fetcher[
Narrow 60-day Channel Near Bottom
and adx(5) is below 40
Set{MACDDiff, MACD fast line(4,8) - MACD slow line(4,8) }
set{MACDb,days(MACDDiff is above MACDDiff 1 day ago,100)}
set{MACDa,days(MACDDiff is below MACDDiff 1 day ago,100)}
set{MACDX, MACDa - MACDb}

Set{Bullpower, high minus ema(13)}
Set{Bearpower, low minus ema(13)}
set{BLb,days(BullPower is above BullPower 1 day ago,100)}
set{BLa,days(BullPower is below BullPower 1 day ago,100)}
set{BLxBL, BLa - BLb}
set{BRb,days(BearPower is above BearPower 1 day ago,100)}
set{BRa,days(BearPower is below BearPower 1 day ago,100)}
set{BRxBR, BRa - BRb}

set{BUY_ME,macd(7,12,3)}
set{SHORT_ME,macd(5,3,3)}
set{cross_me,buy_me - short_me}

SET{LONG,COUNT(BUY_ME CROSSED ABOVE SHORT_ME,1)}
SET{SHORT,COUNT(SHORT_ME CROSSED ABOVE BUY_ME,1)}

Draw Bullpower
Draw Bearpower
Draw SHORT_ME on plot BUY_ME
Draw FI(2)
ADD COLUMN SEPARATOR
add column BLxBL
add column BRxBR
ADD COLUMN SEPARATOR
add column MACDX
ADD COLUMN SEPARATOR
add column PE
add column ADX(14)
]




Eman93
4,750 posts
msg #85390
Ignore Eman93
1/1/2010 8:19:56 PM

This is an old filter I picked up on here..... the results I get out my saved filter are diffrent for some reason.....


jcollins01
29 posts
msg #85392
Ignore jcollins01
1/1/2010 9:54:40 PM

Not exactly what I was looking for but an excellent start! thank you very much!

Eman93
4,750 posts
msg #85393
Ignore Eman93
1/1/2010 9:57:45 PM

Just made this also some nice stuff just run a search on channel.......

Fetcher[/* Emans 90 day channeling stocks*/

close is above 1
volume > 500000
set{90dl, count(price crossed bottom of a 90 day channel,100)}
set{90dh, count(price crossed top of a 90 day channel,100)}

90dl > 3
90dh > 3

draw 90 day channel

add column 90dl

add column 90dh

add column sector
]





johnpaulca
12,036 posts
msg #85395
Ignore johnpaulca
1/1/2010 10:31:26 PM

Good work E....check out NZ from the screen

miketranz
962 posts
msg #85423
Ignore miketranz
1/2/2010 1:10:14 PM

Channel plays all look good on the charts.The problem is by the time they are established,you enter one on the bottom,they go nowhere.Good shorts if anything.Someone needs to come up with a filter for stocks breaking down under a trading range.It takes everyone out,brings short sellers in.Enter a position if the stock reverses & comes back into the trading range.I've seen this pattern happen time after time.The stock most of the time will trade up or past the upper trading range price.I'm surprised no one has seen this pattern before.Good money maker,catching most people on the wrong end of the trade,just like clockwork.

fortyfour
189 posts
msg #85433
Ignore fortyfour
modified
1/2/2010 4:38:33 PM

Here is my display for searching for the type of stocks you mention.
I click sort columns and change the code of columns to search for stocks.
For example if I change the 1.5x volatility corssovers to the last 5 days I can see
which stocks exploded up or down on a given week..... etc.... ad nauseum...
Williams < WHATEVER restricts AAPL's or anyone away from lower BB
Choose your own entry criteria.
See Chet for programming details!
I use a setting chart = LINE so its not so cluttered. Suit yourself...
Good Luck.


/
Fetcher[*display percentage above the lower bollinger band(12)*/
/*if not in dispaly only mode use slow TOMMS HULL ma line for buy signal*/
/*display ma(90) and 1.5 * ma(90) of BB(12) DIFF */
/* Johns crazy bb display*/
/*trend I is ma(150)*/

/***************TOMMS HULL MOVING AVERAGE.....SLOWAVG ONLY IS USED**************/
set{f1,cwma(close,5)}
set{f2,2 * f1}
set{f3,cwma(close,10)}
set{valfast,f2 - f3}
set{fastavg,cwma(valfast,4)}

set{Vs1,cwma(close,13)}
set{Vs2,2 * Vs1}
set{Vs3,cwma(close,25)}
set{valslow,f2 - f3}
set{slowavg,cwma(valslow,7)}
/************************************/
do not draw slowavg on plot close


/***************************************************************************************/
/*PERCENTAGE DIFFERENCE BETWEEN STOCK PRICE AND LOWER BB(12)*/
/***************************************************************************************/
set{cdiff, close - lower bollinger band(12)}
set{temp, cdiff/ lower bollinger band(12)}
set{PERCENTnearLOWBB, temp * 100}

/***********************CHART SETUP********************/
chart-display is weekly /*required for funny weekly day change visual thing*/
cema(weekly day change,3) below 100 /*required to get daily display of price*/
/********************************************************/

close > 10
avg vol(30) > 300000
count(close > ma(150),75) above 65
cema(bollinger diff(12),90) > .05 /*minimum trading volatility*/



/***********************************************************************************************************/
/*IN LAST 90 DAYS, HOW MANY TIMES DAILY BB VOLATILITY CROSSES THE MA(90) OF VOLATILITY */
/***********************************************************************************************************/
set{xcount90, count(bollinger diff(12) crossed above cema(bollinger diff(12),90) ,1)}
set{xoversum90, sum(xcount90,90)}
xoversum90 > 2
/***************************************************/


***********************************************************************************************************/
/*IN LAST 30 DAYS,HOW MANY TIMES DAILY BB VOLATILITY CROSSES THE MA(90) OF VOLATILITY */
/***********************************************************************************************************/
set{xcount30, count(bollinger diff(12) crossed above cema(bollinger diff(12),90) ,1)}
set{xoversum30, sum(xcount90,30)} /*adjust this number for short volatility lookback*/
/*xoversum30 > 0*/
/***************************************************/


/*********************BUY SIGNAL****************/
/*close crossed above slowavg*/ /*comment out buy signal for display only*/
count williams %r(12) < -40
count(williams %r(12) < -60,4) > 0

/***************************************************/

/****************HIGHER VOLATILITY BAR (1.3x)......COUNT AND DISPLAY THIS*****/
set{onefive, 1.3 * cema(bollinger diff(12),90) }
set{onefivecount , count(bollinger diff(12) crossed above onefive ,1) }
set{onefivesum, sum(onefivecount,90)}
add column onefivesum
draw onefive on plot bollinger diff(12)
/******************************************************************************************/


draw bollinger band(12)
draw cema(bollinger diff(12),90)
draw ma(150)
draw bollinger band(40,.2)

add column xoversum90
add column xoversum30
add column cema(bollinger diff(12),90)
add column PERCENTnearLOWBB
sort column 5 descending

do not draw weekly day change
do not draw xoversum90
do not draw xoversum30


add column williams %r(12)
]






jcollins01
29 posts
msg #85434
Ignore jcollins01
modified
1/2/2010 5:03:58 PM

I finally figured it out; stocks that trend strongly will have a greater slope on average, whereas stocks the just plod along will have a slope approaching 0. hence:
Fetcher[
set {slope1,abs(5 day slope of close)}
draw slope1
add column slope1
set{slopesum,sum(slope1,90)}
add column slopesum
sort by column 6 descending
volume greater than 500,000
price greater than 10
]



Eman93
4,750 posts
msg #85548
Ignore Eman93
modified
1/5/2010 2:00:37 AM

Fetcher[ /*Emans Lin Reg 90 day channel near bottom*/
close > 1
volume > 500000

set{90dal, count(Price crossed Bottom Linear Regression Line(90,0.618),100)}
set{90dah, count(Price crossed Top Linear Regression Line(90,0.618),100)}
set{upper, Top Linear Regression Line(90,0.618) + 0}
set{lower, bottom Linear Regression Line(90,0.618) + 0}
Linear Regression Slope(90) > 0

low below Bottom Linear Regression Line(90,0.618)
close above Bottom Linear Regression Line(90,0.618)

draw Top Linear Regression Line(90, 0.618)
draw Bottom Linear Regression Line(90,0.618)



add column 90dal
add column 90dah

add column Linear Regression Slope(90)
add column upper
add column lower
add column high
add column low
add column sector
]



StockFetcher Forums · General Discussion · Finding stocks that trend - highly directional within a range<< 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.