StockFetcher Forums · Filter Exchange · Range Contraction/Expansion Filter<< 1 ... 6 7 8 9 10 ... 12 >>Post Follow-up
alf44
2,025 posts
msg #67195
Ignore alf44
9/11/2008 9:59:55 PM

thanks, tomm !

mystiq
650 posts
msg #67203
Ignore mystiq
9/12/2008 4:42:13 AM

thanks guys-

alf44
2,025 posts
msg #67237
Ignore alf44
modified
9/12/2008 10:41:17 PM

pop-to-tha-top !!!

(Since there were posting issues (with my most recent post of 9/11) ... that resulted in a number of now deleted posts ... to find a "fix" !)

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


This is the current version of the Range Contraction/Expansion Filter !

A few NEW things since the last version I posted...I've cleaned up some things...added some NEW patterns...refined my displayed Technical Indicators...and even created a NEW Trend Indicator based on MMAs !

This continues to be a work in progress...

...as I trade with it and see things that need to be tweaked / added / eliminated and that would be helpful in my trading...they shall be tweaked / added / eliminated !!!

--------------------------------------------------------------------------------------------------------------

Fetcher[/* BRAND NEW Range Contraction/Expansion Scan Filter V v.2.4 - developing */

/* PRICE PATTERNS */

/* Shark-32 ("shark") --> (2 Consecutive Inside Days) */
set{IDhi_2, count(High 1 day ago is below High 2 days ago, 1)}
set{IDlo_2, count(Low 1 day ago is above Low 2 days ago, 1)}
set{IDhilo_2, IDhi_2 * IDlo_2}

set{IDhi_1, count(High is below High 1 day ago, 1)}
set{IDlo_1, count(Low is above Low 1 day ago, 1)}
set{IDhilo_1, IDhi_1 * IDlo_1}

set{ID21, IDhilo_2 * IDhilo_1}

/* --------------------------------------------- */

/* IDs ("...id") (Inside Days -> H/L Range inside H/L Range 1 day ago) */
set{IDhi, count(High below High 1 day ago, 1)}
set{IDlo, count(Low above Low 1 day ago, 1)}
set{ID, IDhi * IDlo}

/* --------------------------------------------- */

/* NR7s ("nr.7") (Narrowist Range of the last 7 days) */
set{NR7, count(Day Point Range reached a new 7 day Low, 1)}

/* ---------------------------------------------- */

/* NR4s ("nr.4") (Narrowist Range of the last 4 days) */
set{NR4, count(Day Point Range reached a new 4 day Low, 1)}

/* ----------------------------------------------- */

/* Gaps ("gap") (Unfilled Gaps) */
set{Gapup, count(Low is above High 1 day ago, 1)}
set{Gapdwn, count(High is below Low 1 day ago, 1)}
set{GapupORGapdwn, Gapup + Gapdwn}

/* ------------------------------------------------ */

/* Doji ("doji") (H/L Rng above .20 w/Candle Body less than 30% of H/L Rng) */
set{HiLoRng, High - Low}
set{ClOpRng, abs(Close minus Open)}
set{ClOp_HiLo_ratio, ClOpRng / HiLoRng}
set{Range, count(HiLoRng is above .20, 1)}
set{Body, count(ClOp_HiLo_ratio is less than .30, 1)}
set{doji, Range * Body}

/* -------------------------------------------------- */

/* 8020 ("8020") (Open AND Close take place at extremes in the Day Positions ...ie...Open>80%,Close<20% or, vice versa) */

/* Day Position Calculations for 80/20 Days */
set{Range1, High - Low}
set{CloLodiff, Close - Low}
set{OpLodiff, Open - Low}
set{dayposcl, CloLodiff / Range1}
set{dayposop, OpLodiff / Range1}

/* 80/20 Day with an UP Close */
set{dpCloUp, count(dayposcl is above .80, 1)}
set{dpOpUp, count(dayposop is below .20, 1)}
set{Up8020, dpCloUp * dpOpUp}

/* 80/20 Day with a DOWN Close */
set{dpOpDwn, count(dayposop is above .80, 1)}
set{dpCloDwn, count(dayposcl is below .20, 1)}
set{Dwn8020, dpOpDwn * dpCloDwn}
set{8020upORdwn, Up8020 + Dwn8020}

/* --------------------------------------------------- */

/* One Day Reversal ("odr") (5 Day H / L w/Up or Down Close Above/Below 50% Day Position) */

/* "ODR" 50% Day Position Calculation */
set{HLrng, High - Low}
set{HLrng50, HLrng * .50}
set{DP50, Low + HLrng50}

/* "ODR" UP */
set{5daylo, count(Low reached a new 5 day Low, 1)}
set{ODR_UpClo, count(Close is above DP50, 1)}
set{ODR_Up, 5daylo * ODR_UpClo}

/* "ODR" DOWN */
set{5dayhi, count(High reached a new 5 day High, 1 )}
set{ODR_DwnClo, count(Close is below DP50, 1)}
set{ODR_Dwn, 5dayhi * ODR_DwnClo}

/* "ODR" UP or DOWN */
set{ODR_upORdwn, ODR_Up + ODR_Dwn}

/* ---------------------------------------------- */

/* ROC(2) Divergence (".div") (one day ROC2 pos/neg divergence with Close) */

/* ROC(2) Bullish Divergence Calculation */
set{3daylo, count(Low reached a new 3 day Low, 1)}
set{ROCdivpos1, count(ROC(2) above ROC(2) 1 day ago, 1)}
set{ROCdivpos2, count(ROC(2) 1 day ago below ROC(2) 2 days ago, 1)}
set{ROCbulldiv1, 3daylo * ROCdivpos1}
set{ROCbulldiv2, ROCbulldiv1 * ROCdivpos2}

/* ROC(2) Bearish Divergence Calculation*/
set{3dayhi, count(High reached a new 3 day High, 1)}
set{ROCdivneg1, count(ROC(2) below ROC(2) 1 day ago, 1)}
set{ROCdivneg2, count(ROC(2) 1 day ago above ROC(2) 2 days ago, 1)}
set{ROCbeardiv1, 3dayhi * ROCdivneg1}
set{ROCbeardiv2, ROCbeardiv1 * ROCdivneg2}

/* ROC(2) Bullish OR Bearish Divergence */
set{ROCbullORbeardiv, ROCbulldiv2 + ROCbeardiv2}

/* --------------------------------------------------- */

/* WR4s ("wr.4") (Widest Range of the last 4 days) */
set{WR4, count(Day Point Range reached a new 4 day High, 1)}

/* ---------------------------------------------------- */

/* WR7s ("wr.7") (Widest Range of the last 7 days) */
set{WR7, count(Day Point Range reached a new 7 day High, 1)}

/* ---------------------------------------------------- */

/* ODs ("od") (Outside Days -> H/L Range outside H/L Range 1 day ago) */
set{ODhi, count(High above High 1 day ago, 1)}
set{ODlo, count(Low below Low 1 day ago, 1)}
set{OD, ODhi * ODlo}

/* ----------------------------------------------------- */

/* Windups ("wup") (Outside Day followed by an Inside Day) */
set{WUp_ODhi, count(High 1 day ago above High 2 days ago, 1)}
set{WUp_ODlo, count(Low 1 day ago below Low 2 days ago, 1)}
set{WUp_ODhilo, WUp_ODhi * WUp_ODlo}

set{WUp_IDhi, count(High below High 1 day ago, 1)}
set{WUp_IDlo, count(Low above Low 1 day ago, 1)}
set{WUp_IDhilo, WUp_IDhi * WUp_IDlo}
set{WUp, WUp_ODhilo * WUp_IDhilo}

/* ------------------------------------------------------- */

/* Crable Hooks ("hook") */

/* "BULL" Hook --> (Open above prev. High with Close below prev. Close & Range < prev. day's Range) */

set{RangeDWN, High - Low}
set{RangeDWN_1, High 1 day ago - Low 1 day ago}

set{RangeHookDWN, count(RangeDWN < RangeDWN_1, 1)}
set{OpenHookDWN, count(Open above High 1 day ago, 1)}
set{CloseHookDWN, count(Close below Close 1 day ago, 1)}

set{Hook_DWN_A, RangeHookDWN * OpenHookDWN}
set{BullHookDWN, Hook_DWN_A * CloseHookDWN}


/* "BEAR" Hook --> (Open below prev. Low with Close above prev. Close & Range < prev. day's Range) */
set{RangeUP, High - Low}
set{RangeUP_1, High 1 day ago - Low 1 day ago}

set{RangeHookUP, count(RangeUP < RangeUP_1, 1)}
set{OpenHookUP, count(Open below Low 1 day ago, 1)}
set{CloseHookUP, count(Close above Close 1 day ago, 1)}

set{Hook_UP_A, RangeHookUP * OpenHookUP}
set{BearHookUP, Hook_UP_A * CloseHookUP}


/* BearHookUP OR BullHookDOWN */
set{BearHookUPorBullHookDOWN, BearHookUP + BullHookDWN}

/* ------------------------------------------------- */

/* Stowell Naked Close ("naked") */

/* "Bull Naked LONG" --> (Close below prev. Low with 10 day Slope of EMA(13) & 5 day Slope of Lows > 0) */

set{nakedTrendUP, count(10 day Slope of EMA(13) above 0, 1)}
set{nakedLo, count( 5 day Slope of Low above 0, 1)}
set{nakedClLow, count(Close below Low 1 day ago, 1)}

set{naked1, nakedTrendUP * nakedLo}
set{nakedLONG, naked1 * nakedClLow}


/* "Bear Naked SHORT" --> (Close above prev. High with 10 day Slope of EMA(13) & 5 day Slope of Highs < 0) */

set{nakedTrendDWN, count(10 day Slope of EMA(13) below 0, 1)}
set{nakedHi, count( 5 day Slope of High below 0, 1)}
set{nakedClHigh, count(Close above High 1 day ago, 1)}

set{naked2, nakedTrendDWN * nakedHi}
set{nakedSHORT, naked2 * nakedClHigh}

/* Naked Close LONG or SHORT */
set{nakedLoS, nakedLONG + nakedSHORT}

/* ----------------------------------------------------- */

/* Williams Hidden Smash ("smash") */

/* HiLo Range */
set{HLrng1, High - Low}

/* "Bull Hidden Smash LONG" --> (Close above prev. Close but Close < 25% day pos. & Close < Open) */

/* "Smash" 25% Day Position Calculation */
set{HLrng25, HLrng1 * .25}
set{DP25, Low + HLrng25}

/* "Bull Smash" Fetch */
set{SmashCloA1, count(Close above Close 1 day ago,1)}
set{SmashCloB1, count(Close below Open, 1)}
set{SmashDP1, count(Close below DP25, 1)}

set{SmashA1, SmashCloA1 * SmashCloB1}
set{SmashA2, SmashA1 * SmashDP1}


/* "Bear Hidden Smash SHORT" --> (Close below prev. Close but Close > 75% day pos. & Close > Open) */

/* "Smash" 75% Day Position Calculation */
set{HLrng75, HLrng1 * .75}
set{DP75, Low + HLrng75}

/* "Bear Smash" Fetch */
set{SmashCloA11, count(Close below Close 1 day ago,1)}
set{SmashCloB11, count(Close above Open, 1)}
set{SmashDP11, count(Close above DP75, 1)}

set{SmashA11, SmashCloA11 * SmashCloB11}
set{SmashA22, SmashA11 * SmashDP11}

/* LONG or SHORT Hidden Smash */
set{LOS_HidSmash, SmashA2 + SmashA22}

/* --------------------------------------------------- */

/* PRICE ACTION STUFF ... AT A GLANCE */

/* Trend (short/intermediate/long-term) --> ("trend") */
set{T13_34, count(EMA(13) above EMA(34), 1)}
set{T13_90, count(EMA(13) above EMA(90), 1)}
set{T34_90, count(EMA(34) above EMA(90), 1)}
set{T1, T13_34 * 1}
set{T2, T13_90 * 10}
set{T3, T34_90 * 100}
set{Trend12, T1 + T2}
set{Trend123, Trend12 + T3}

/* ---------------- */

/* 20 Day High/Low Breakout Check ("20hilo") */

/* 20 day HIGH */
set{20dayhi, count(High reached a new 20 day High, 1 )}

/* 20 day LOW */
set{20daylo, count(Low reached a new 20 day Low, 1)}

/* 20 day HIGH or LOW */
set{20day_hiORlo, 20dayhi + 20daylo }

/* ------------------ */

/* Consecutive days Close either Up(+) or Down(-) --> ("..clo^") */
set{daysCloseUp, days(Close below Close 1 day ago,100)}
set{daysCloseDown, days(Close above Close 1 day ago,100)}
set{daysClosecurdir, daysCloseUp - daysCloseDown}

/* Consecutive days LOWS either Up(+) or Down(-) --> ("..lo^") */
set{daysLOWSUp, days(Low below Low 1 day ago,100)}
set{daysLOWSDown, days(Low above Low 1 day ago,100)}
set{daysLOWScurdir, daysLOWSUp - daysLOWSDown}

/* Consecutive days HIGHS either Up(+) or Down(-) --> ("..hi^") */
set{daysHIGHSUp, days(High below High 1 day ago,100)}
set{daysHIGHSDown, days(High above High 1 day ago,100)}
set{daysHIGHScurdir, daysHIGHSUp - daysHIGHSDown}

/* ------------------- */

/* Day Position Calculation ("..dp") */
set{Range1a, High - Low}
set{CloLodiffa, Close - Low}
set{dayposcla, CloLodiffa / Range1a}

/* --------------------- */

/* Historical Volatility Ratio ("vrat") (compare a 6 day to a 100 day Historical Volatility) */

/* Historical Volatility Ratio Calculation */
set{HistVol6, Historical Volatility(6,1)}
set{HistVol100, Historical Volatility(100,1)}
set{HistVolRatio, HistVol6 / HistVol100}

set{HVRatio, count(HistVolRatio is less than .51, 1)}

/* ------------------------------------------------------- */

/* 2 PERIOD ROC STUFF */

/* ROC2 Pivot ("rocpiv") */

/* ROC2 Pivot Calculation --> (Closing price (tomorrow) that will either maintain the current direction of the ROC(2) indicator...OR...turn it in the other direction) */

set{ROCpivA, Close - Close 2 days ago}
set{ROCpiv, ROCpivA + Close 1 day ago}


/* ROC2 Momentum ("roc^") */

/* ROC2 Momentum Calculation --> Days ROC2 either Up(+) or Down(-) */
set{daysROCup, days(ROC(2) below ROC(2) 1 day ago,100)}
set{daysROCdwn, days(ROC(2) above ROC(2) 1 day ago,100)}
set{dayscurdir, daysROCup - daysROCdwn}

/* ------------------------------------------------------ */

/* TRADE ENTRY / EXIT STUFF */

/* Crable Opening Range Breakout ("stretch")
(Average of the differences between the Open each day and the closest extreme (ie. H / L) to the Open each day over the previous 10 days...the "stretch" is then add. / subt. to today's Open giving price levels for either a Long / Short entry */

/* ORB "STRETCH" Calculations */
set{diff1, abs(Open minus High)}
set{diff2, abs(Open minus Low)}
set{stretch_diff, min(diff1,diff2)}

set{stretch_sum, sum(stretch_diff,10)}
set{stretch_avg10, stretch_sum / 10}


/* Profit Target ("profit") -> (An amount based on 66% of a 10 day average of the H / L Range that when add. / subt. to entry gives a "theoretical profit target" ) */

/* Profit Target Calculations */
set{HiLo_rng, High minus Low}
set{HiLo_rngsum, sum(HiLo_rng,10)}
set{HiLo_rngavg, HiLo_rngsum / 10}

set{ProfTarget_66, HiLo_rngavg * .66}

/* ----------------------------------------------- */

/* TECHNICAL INDICATORS */

/* Defining "my ROC(2)" Indicator */
set{myROC, ROC(2)}

/* Defining "myOSC(3,8)" Indicator */
set{myOSC, EMA(3) - EMA(8)}

/* Defining "trend(13) of myOSC(3,8)" Indicator */
set{myOSCtrend, CEMA(myOSC,13)}

/* Defining my Multiple Moving Average TREND Indicator */
set{typprice_A, High 3 day High + Low 3 day Low}
set{typprice_sumA, typprice_A + Close}
set{typpriceA, typprice_sumA / 3}

/* (My version of Guppy MMAs...a sorta "moving daily pivot" based on today's Close & the 3 day Highs and Lows...displayed as an array of 2 groups of EMAs with different time frames) */

/* --------------------------------------------------------- */

/* SYMBOL SELECTION */

Apply to symlist(QQQQ,QLD,QID,SPY,SSO,SDS,DIA,DDM,DXD,MDY,MVV,MZZ)

/* Market is NASDAQ 100 */
/* Market is S&P 500 */
/* Market is DOW 30 */

/* ------------------------------------------ */

/* COLUMNS */

/* Columns (Trend Strength) */
add column separator
add column separator
add column Trend123 {trend}
add column separator
add column 20day_hiORlo {20hilo}
add column daysClosecurdir {..clo^}
add column daysLOWScurdir {..lo^}
add column daysHIGHScurdir {..hi^}
add column separator
add column dayposcla {..dp}
add column separator
add column HVRatio {vrat.}

/* Columns (Patterns) */
add column separator
add column separator
add column ID21 {Shark}
add column ID {...id}
add column NR7 {nr.7}
add column NR4 {nr.4}
add column GapupORGapdwn {Gap}
add column doji
add column separator
add column 8020upORdwn {8020}
add column separator
add column ODR_upORdwn {ODR}
add column ROCbullORbeardiv {.DIV}
add column WR4 {wr.4}
add column WR7 {wr.7}
add column OD {..od}
add column WUp
add column separator
add column separator
add column BearHookUPorBullHookDOWN {hook}
add column nakedLoS {naked}
add column LOS_HidSmash {smash}
add column separator
add column separator

/* Columns (ROC2 Momentum "stuff") */
add column ROCpiv {ROCpiv}
add column dayscurdir {ROC^}
add column separator
add column separator

/* Crabel ORB stuff */
add column stretch_avg10{stretch}
add column ProfTarget_66{Profit}
add column separator
add column separator

/* ------------------------------------ */

/* INDICATORS */

/* Indicators MAs */
draw EMA(13)
draw EMA(34)
draw EMA(90)

/* Indicators Momentum and Trend */
draw myROC
draw myROC line at 0

draw myOSC
draw myOSC line at 0
draw CEMA(myOSC,13)

draw CCI(34) line at 0
draw CCI(34) line at -100
draw CCI(34) line at +100
draw CEMA(CCI(34),5)

draw CEMA(typpriceA, 2)
draw CEMA(typpriceA, 3)
draw CEMA(typpriceA, 5)
draw CEMA(typpriceA, 8)
draw CEMA(typpriceA, 13)

draw CEMA(typpriceA, 26)
draw CEMA(typpriceA, 30)
draw CEMA(typpriceA, 34)
draw CEMA(typpriceA, 40)
draw CEMA(typpriceA, 50)

do not draw typpriceA

sort column 42 descending
]



-----------------------------------------------------------------------

Regards,

alf44


alf44
2,025 posts
msg #69700
Ignore alf44
modified
12/8/2008 9:43:36 PM

Howz bout an UPDATE !!!

------------------------------------

Recently, I've been playing around with a filter that "TheRumpledOne" posted about a year ago !

The filter was an attempt by TRO to duplicate the criteria of a trade set-up called...

a "Dummy Spot" !

News Flash: NOTHING NEW HERE !!!

A so-called "Dummy Spot" is nothing more than an Inside day...that happens with the preceding days showing decreasing volumes...as the daily ranges consolidate (ie. tighten) !

Now...those familiar with my Range Contraction / Expansion Filter know that "Inside Days" have been an integral part of the filter since the very first rendition. That being the case...I am always interested in anything posted here at SF (or, anywhere else for that matter) wrt these kinds of "consolidation and expansion" patterns.

The THING that caught my eye with THIS TRO filter ("Dummy Spots") was NOT the "Inside Day" aspect of it...it was the clever way TRO calculated AND displayed the consecutive days that both the RANGE and the VOLUME had been decreasing.

I confess...the coding trick TRO uses is one I have used/borrowed/stolen before...just never as a way to monitor Range and Volume Contraction/Expansion. fwiw

It dawned on me that since I already had NR4s, NR7s, Sharks and IDs etc...in my (this) filter...I could in effect EASILY incorporate a "Dummy Spot" check ...and, in the process ADD to the overall feedback that the column displays provide (to the other patterns in the filter).

* The 2 NEW columns are ...vol^ ... AND...rng^ !

--> (Scroll DOWN to the section of code labeled "Dummy Spots" to see the NEW additions) <--

I view these 2 NEW columns as an indication of sort-term volatility (or, lack thereof). With that in mind, they have replaced my PREVIOUS attempt at monitoring short-term volatility. Previously, I compared a 6 period Historical Volatility measure to a 100 day Historical Volatility. NO MORE !

I will experiment with these 2 NEW columns for now...and see how they perform.

I feel they give me MORE "at-a-glance" feedback wrt to RANGE and VOLUME...and help me better spot areas of possible CONTRACTION and EXPANSION !

-----------

As always...this continues to be a work in progress...

...as I trade with it and see things that need to be tweaked / added / eliminated and that would be helpful in my trading...they shall be tweaked / added / eliminated !!! (as it were) :8^)

---------------------------------------------------------

This is the NEW-est version of the Range Contraction/Expansion Filter !


Fetcher[/* BRAND NEW Range Contraction/Expansion Scan Filter V v.2.5 */

/* PRICE PATTERNS */

/* Shark-32 ("shark") --> (2 Consecutive Inside Days) */
set{IDhi_2, count(High 1 day ago is below High 2 days ago, 1)}
set{IDlo_2, count(Low 1 day ago is above Low 2 days ago, 1)}
set{IDhilo_2, IDhi_2 * IDlo_2}

set{IDhi_1, count(High is below High 1 day ago, 1)}
set{IDlo_1, count(Low is above Low 1 day ago, 1)}
set{IDhilo_1, IDhi_1 * IDlo_1}

set{ID21, IDhilo_2 * IDhilo_1}

/* --------------------------------------------- */

/* IDs ("...id") (Inside Days -> H/L Range inside H/L Range 1 day ago) */
set{IDhi, count(High below High 1 day ago, 1)}
set{IDlo, count(Low above Low 1 day ago, 1)}
set{ID, IDhi * IDlo}

/* --------------------------------------------- */

/* NR7s ("nr.7") (Narrowist Range of the last 7 days) */
set{NR7, count(Day Point Range reached a new 7 day Low, 1)}

/* ---------------------------------------------- */

/* NR4s ("nr.4") (Narrowist Range of the last 4 days) */
set{NR4, count(Day Point Range reached a new 4 day Low, 1)}

/* ----------------------------------------------- */

/* Gaps ("gap") (Unfilled Gaps) */
set{Gapup, count(Low is above High 1 day ago, 1)}
set{Gapdwn, count(High is below Low 1 day ago, 1)}
set{GapupORGapdwn, Gapup + Gapdwn}

/* ------------------------------------------------ */

/* Doji ("doji") (H/L Rng above .20 w/Candle Body less than 30% of H/L Rng) */
set{HiLoRng, High - Low}
set{ClOpRng, abs(Close minus Open)}
set{ClOp_HiLo_ratio, ClOpRng / HiLoRng}
set{Range, count(HiLoRng is above .20, 1)}
set{Body, count(ClOp_HiLo_ratio is less than .30, 1)}
set{doji, Range * Body}

/* -------------------------------------------------- */

/* 8020 ("8020") (Open AND Close take place at extremes in the Day Positions ...ie...Open>80%,Close<20% or, vice versa) */

/* Day Position Calculations for 80/20 Days */
set{Range1, High - Low}
set{CloLodiff, Close - Low}
set{OpLodiff, Open - Low}
set{dayposcl, CloLodiff / Range1}
set{dayposop, OpLodiff / Range1}

/* 80/20 Day with an UP Close */
set{dpCloUp, count(dayposcl is above .80, 1)}
set{dpOpUp, count(dayposop is below .20, 1)}
set{Up8020, dpCloUp * dpOpUp}

/* 80/20 Day with a DOWN Close */
set{dpOpDwn, count(dayposop is above .80, 1)}
set{dpCloDwn, count(dayposcl is below .20, 1)}
set{Dwn8020, dpOpDwn * dpCloDwn}
set{8020upORdwn, Up8020 + Dwn8020}

/* --------------------------------------------------- */

/* One Day Reversal ("odr") (5 Day H / L w/Up or Down Close Above/Below 50% Day Position) */

/* "ODR" 50% Day Position Calculation */
set{HLrng, High - Low}
set{HLrng50, HLrng * .50}
set{DP50, Low + HLrng50}

/* "ODR" UP */
set{5daylo, count(Low reached a new 5 day Low, 1)}
set{ODR_UpClo, count(Close is above DP50, 1)}
set{ODR_Up, 5daylo * ODR_UpClo}

/* "ODR" DOWN */
set{5dayhi, count(High reached a new 5 day High, 1 )}
set{ODR_DwnClo, count(Close is below DP50, 1)}
set{ODR_Dwn, 5dayhi * ODR_DwnClo}

/* "ODR" UP or DOWN */
set{ODR_upORdwn, ODR_Up + ODR_Dwn}

/* ---------------------------------------------- */

/* ROC(2) Divergence (".div") (one day ROC2 pos/neg divergence with Close) */

/* ROC(2) Bullish Divergence Calculation */
set{3daylo, count(Low reached a new 3 day Low, 1)}
set{ROCdivpos1, count(ROC(2) above ROC(2) 1 day ago, 1)}
set{ROCdivpos2, count(ROC(2) 1 day ago below ROC(2) 2 days ago, 1)}
set{ROCbulldiv1, 3daylo * ROCdivpos1}
set{ROCbulldiv2, ROCbulldiv1 * ROCdivpos2}

/* ROC(2) Bearish Divergence Calculation*/
set{3dayhi, count(High reached a new 3 day High, 1)}
set{ROCdivneg1, count(ROC(2) below ROC(2) 1 day ago, 1)}
set{ROCdivneg2, count(ROC(2) 1 day ago above ROC(2) 2 days ago, 1)}
set{ROCbeardiv1, 3dayhi * ROCdivneg1}
set{ROCbeardiv2, ROCbeardiv1 * ROCdivneg2}

/* ROC(2) Bullish OR Bearish Divergence */
set{ROCbullORbeardiv, ROCbulldiv2 + ROCbeardiv2}

/* --------------------------------------------------- */

/* WR4s ("wr.4") (Widest Range of the last 4 days) */
set{WR4, count(Day Point Range reached a new 4 day High, 1)}

/* ---------------------------------------------------- */

/* WR7s ("wr.7") (Widest Range of the last 7 days) */
set{WR7, count(Day Point Range reached a new 7 day High, 1)}

/* ---------------------------------------------------- */

/* ODs ("od") (Outside Days -> H/L Range outside H/L Range 1 day ago) */
set{ODhi, count(High above High 1 day ago, 1)}
set{ODlo, count(Low below Low 1 day ago, 1)}
set{OD, ODhi * ODlo}

/* ----------------------------------------------------- */

/* Windups ("wup") (Outside Day followed by an Inside Day) */
set{WUp_ODhi, count(High 1 day ago above High 2 days ago, 1)}
set{WUp_ODlo, count(Low 1 day ago below Low 2 days ago, 1)}
set{WUp_ODhilo, WUp_ODhi * WUp_ODlo}

set{WUp_IDhi, count(High below High 1 day ago, 1)}
set{WUp_IDlo, count(Low above Low 1 day ago, 1)}
set{WUp_IDhilo, WUp_IDhi * WUp_IDlo}
set{WUp, WUp_ODhilo * WUp_IDhilo}

/* ------------------------------------------------------- */

/* Crable Hooks ("hook") */

/* "BULL" Hook --> (Open above prev. High with Close below prev. Close & Range < prev. day's Range) */

set{RangeDWN, High - Low}
set{RangeDWN_1, High 1 day ago - Low 1 day ago}

set{RangeHookDWN, count(RangeDWN < RangeDWN_1, 1)}
set{OpenHookDWN, count(Open above High 1 day ago, 1)}
set{CloseHookDWN, count(Close below Close 1 day ago, 1)}

set{Hook_DWN_A, RangeHookDWN * OpenHookDWN}
set{BullHookDWN, Hook_DWN_A * CloseHookDWN}


/* "BEAR" Hook --> (Open below prev. Low with Close above prev. Close & Range < prev. day's Range) */
set{RangeUP, High - Low}
set{RangeUP_1, High 1 day ago - Low 1 day ago}

set{RangeHookUP, count(RangeUP < RangeUP_1, 1)}
set{OpenHookUP, count(Open below Low 1 day ago, 1)}
set{CloseHookUP, count(Close above Close 1 day ago, 1)}

set{Hook_UP_A, RangeHookUP * OpenHookUP}
set{BearHookUP, Hook_UP_A * CloseHookUP}


/* BearHookUP OR BullHookDOWN */
set{BearHookUPorBullHookDOWN, BearHookUP + BullHookDWN}

/* ------------------------------------------------- */

/* Stowell Naked Close ("naked") */

/* "Bull Naked LONG" --> (Close below prev. Low with 10 day Slope of EMA(13) & 5 day Slope of Lows > 0) */

set{nakedTrendUP, count(10 day Slope of EMA(13) above 0, 1)}
set{nakedLo, count( 5 day Slope of Low above 0, 1)}
set{nakedClLow, count(Close below Low 1 day ago, 1)}

set{naked1, nakedTrendUP * nakedLo}
set{nakedLONG, naked1 * nakedClLow}


/* "Bear Naked SHORT" --> (Close above prev. High with 10 day Slope of EMA(13) & 5 day Slope of Highs < 0) */

set{nakedTrendDWN, count(10 day Slope of EMA(13) below 0, 1)}
set{nakedHi, count( 5 day Slope of High below 0, 1)}
set{nakedClHigh, count(Close above High 1 day ago, 1)}

set{naked2, nakedTrendDWN * nakedHi}
set{nakedSHORT, naked2 * nakedClHigh}

/* Naked Close LONG or SHORT */
set{nakedLoS, nakedLONG + nakedSHORT}

/* ----------------------------------------------------- */

/* Williams Hidden Smash ("smash") */

/* HiLo Range */
set{HLrng1, High - Low}

/* "Bull Hidden Smash LONG" --> (Close above prev. Close but Close < 25% day pos. & Close < Open) */

/* "Smash" 25% Day Position Calculation */
set{HLrng25, HLrng1 * .25}
set{DP25, Low + HLrng25}

/* "Bull Smash" Fetch */
set{SmashCloA1, count(Close above Close 1 day ago,1)}
set{SmashCloB1, count(Close below Open, 1)}
set{SmashDP1, count(Close below DP25, 1)}

set{SmashA1, SmashCloA1 * SmashCloB1}
set{SmashA2, SmashA1 * SmashDP1}


/* "Bear Hidden Smash SHORT" --> (Close below prev. Close but Close > 75% day pos. & Close > Open) */

/* "Smash" 75% Day Position Calculation */
set{HLrng75, HLrng1 * .75}
set{DP75, Low + HLrng75}

/* "Bear Smash" Fetch */
set{SmashCloA11, count(Close below Close 1 day ago,1)}
set{SmashCloB11, count(Close above Open, 1)}
set{SmashDP11, count(Close above DP75, 1)}

set{SmashA11, SmashCloA11 * SmashCloB11}
set{SmashA22, SmashA11 * SmashDP11}

/* LONG or SHORT Hidden Smash */
set{LOS_HidSmash, SmashA2 + SmashA22}

/* --------------------------------------------------- */

/* PRICE ACTION STUFF ... AT A GLANCE */

/* Trend (short/intermediate/long-term) --> ("trend") */
set{T13_34, count(EMA(13) above EMA(34), 1)}
set{T13_90, count(EMA(13) above EMA(90), 1)}
set{T34_90, count(EMA(34) above EMA(90), 1)}
set{T1, T13_34 * 1}
set{T2, T13_90 * 10}
set{T3, T34_90 * 100}
set{Trend12, T1 + T2}
set{Trend123, Trend12 + T3}

/* ------------------------------------------------------ */

/* 20 Day High/Low Breakout Check ("20hilo") */

/* 20 day HIGH */
set{20dayhi, count(High reached a new 20 day High, 1 )}

/* 20 day LOW */
set{20daylo, count(Low reached a new 20 day Low, 1)}

/* 20 day HIGH or LOW */
set{20day_hiORlo, 20dayhi + 20daylo }

/* -------------------------------------------------- */

/* Consecutive days Close either Up(+) or Down(-) --> ("..clo^") */
set{daysCloseUp, days(Close below Close 1 day ago,100)}
set{daysCloseDown, days(Close above Close 1 day ago,100)}
set{daysClosecurdir, daysCloseUp - daysCloseDown}

/* Consecutive days LOWS either Up(+) or Down(-) --> ("..lo^") */
set{daysLOWSUp, days(Low below Low 1 day ago,100)}
set{daysLOWSDown, days(Low above Low 1 day ago,100)}
set{daysLOWScurdir, daysLOWSUp - daysLOWSDown}

/* Consecutive days HIGHS either Up(+) or Down(-) --> ("..hi^") */
set{daysHIGHSUp, days(High below High 1 day ago,100)}
set{daysHIGHSDown, days(High above High 1 day ago,100)}
set{daysHIGHScurdir, daysHIGHSUp - daysHIGHSDown}

/* ----------------------------------------------------- */

/* Day Position Calculation ("..dp") */
set{Range1a, High - Low}
set{CloLodiffa, Close - Low}
set{dayposcla, CloLodiffa / Range1a}

/* ------------------------------------------------------ */

/* DUMMY SPOT STUFF */

/* Consecutive days of Range Contraction / Expansion ("rng^") */
set{dumRange, High - Low}
set{daysRngExpands, days(dumRange below dumRange 1 day ago,100)}
set{daysRngContacts, days(dumRange above dumRange 1 day ago,100)}
set{daysRngcurdir, daysRngExpands - daysRngContacts}

/* Consecutive days of Volume Contraction / Expansion ("vol^") */
set{daysVolUp, days(Volume is below Volume 1 day ago,100)}
set{daysVolDn, days(Volume is above Volume 1 day ago,100)}
set{daysVolcurdir, daysVolUp - daysVolDn}

/* (A Dummy Spot is a Narrow Range Day, a Low Volume Day and an Inside Day - whose break allows you a "low-risk" entry in the direction of the prevailing trend.)*/

/*------------------------------------------------------- */

/* 2 PERIOD ROC STUFF */

/* ROC2 Pivot ("rocpiv") */

/* ROC2 Pivot Calculation --> (Closing price (tomorrow) that will either maintain the current direction of the ROC(2) indicator...OR...turn it in the other direction) */

set{ROCpivA, Close - Close 2 days ago}
set{ROCpiv, ROCpivA + Close 1 day ago}


/* ROC2 Momentum ("roc^") */

/* ROC2 Momentum Calculation --> Days ROC2 either Up(+) or Down(-) */
set{daysROCup, days(ROC(2) below ROC(2) 1 day ago,100)}
set{daysROCdwn, days(ROC(2) above ROC(2) 1 day ago,100)}
set{dayscurdir, daysROCup - daysROCdwn}

/* ------------------------------------------------------ */

/* TRADE ENTRY / EXIT STUFF */

/* Crable Opening Range Breakout ("stretch")
(Average of the differences between the Open each day and the closest extreme (ie. H / L) to the Open each day over the previous 10 days...the "stretch" is then add. / subt. to today's Open giving price levels for either a Long / Short entry */

/* ORB "STRETCH" Calculations */
set{diff1, abs(Open minus High)}
set{diff2, abs(Open minus Low)}
set{stretch_diff, min(diff1,diff2)}

set{stretch_sum, sum(stretch_diff,10)}
set{stretch_avg10, stretch_sum / 10}


/* Profit Target ("profit") -> (An amount based on 66% of a 10 day average of the H / L Range that when add. / subt. to entry gives a "theoretical profit target" ) */

/* Profit Target Calculations */
set{HiLo_rng, High minus Low}
set{HiLo_rngsum, sum(HiLo_rng,10)}
set{HiLo_rngavg, HiLo_rngsum / 10}

set{ProfTarget_66, HiLo_rngavg * .66}

/* ----------------------------------------------- */

/* TECHNICAL INDICATORS */

/* Defining "my ROC(2)" Indicator */
set{myROC, ROC(2)}

/* Defining "myOSC(3,8)" Indicator */
set{myOSC, EMA(3) - EMA(8)}

/* Defining "trend(13) of myOSC(3,8)" Indicator */
set{myOSCtrend, CEMA(myOSC,13)}

/* Defining my Multiple Moving Average TREND Indicator */
set{typprice_A, High 3 day High + Low 3 day Low}
set{typprice_sumA, typprice_A + Close}
set{typpriceA, typprice_sumA / 3}

/* (My version of Guppy MMAs...a sorta "moving daily pivot" based on today's Close & the 3 day Highs and Lows...displayed as an array of 2 groups of EMAs with different time frames) */

/* --------------------------------------------------------- */

/* SYMBOL SELECTION */

Market is NASDAQ 100

/* ------------------------------------------ */

/* COLUMNS */

/* Columns (Trend Strength) */
add column separator
add column separator
add column Trend123 {trend}
add column separator
add column 20day_hiORlo {20hilo}
add column daysClosecurdir {..clo^}
add column daysLOWScurdir {..lo^}
add column daysHIGHScurdir {..hi^}
add column separator
add column dayposcla {..dp}
add column separator
add column separator
add column daysVolcurdir {vol^}
add column daysRngcurdir {rng^}

/* Columns (Patterns) */
add column separator
add column separator
add column ID21 {Shark}
add column ID {...id}
add column NR7 {nr.7}
add column NR4 {nr.4}
add column GapupORGapdwn {Gap}
add column doji
add column separator
add column 8020upORdwn {8020}
add column separator
add column ODR_upORdwn {ODR}
add column ROCbullORbeardiv {.DIV}
add column WR4 {wr.4}
add column WR7 {wr.7}
add column OD {..od}
add column WUp
add column separator
add column separator
add column BearHookUPorBullHookDOWN {hook}
add column nakedLoS {naked}
add column LOS_HidSmash {smash}
add column separator
add column separator

/* Columns (ROC2 Momentum "stuff") */
add column ROCpiv {ROCpiv}
add column dayscurdir {ROC^}
add column separator
add column separator

/* Crabel ORB stuff */
add column stretch_avg10{stretch}
add column ProfTarget_66{Profit}
add column separator
add column separator

/* ------------------------------------ */

/* INDICATORS */

/* Indicators MAs */
draw EMA(13)
draw EMA(34)
draw EMA(90)

/* Indicators Momentum and Trend */
draw myROC
draw myROC line at 0

draw RSI(2)

draw myOSC
draw myOSC line at 0
draw CEMA(myOSC,13)

draw CCI(34) line at 0
draw CCI(34) line at -100
draw CCI(34) line at +100
draw CEMA(CCI(34),5)

draw CEMA(typpriceA, 3)
draw CEMA(typpriceA, 5)
draw CEMA(typpriceA, 8)
draw CEMA(typpriceA, 13)

draw CEMA(typpriceA, 26)
draw CEMA(typpriceA, 30)
draw CEMA(typpriceA, 34)
draw CEMA(typpriceA, 40)
draw CEMA(typpriceA, 50)

do not draw typpriceA

sort column 44 descending
]



--------------------------------------------------------

Regards,

alf44


chetron
2,817 posts
msg #69710
Ignore chetron
12/9/2008 6:52:58 AM

THANX, ALF



alf44
2,025 posts
msg #69716
Ignore alf44
12/9/2008 10:10:44 AM

no prob, chetron !



marine2
829 posts
msg #69733
Ignore marine2
12/10/2008 12:04:49 AM

Wow, if we could unravel this filter we could follow it around the globe its so long. That's alot of code.

johnpaulca
11,312 posts
msg #69743
Ignore johnpaulca
12/10/2008 10:10:48 AM

FMCN....pulled it off ALF44's contraction filter this morning....look at 5min chart. I entered at the open and just closed at 8.88, talk about being parabolic.

BTW- thanks for this sweet filter, I have used it quite frequently.

marine2
829 posts
msg #69748
Ignore marine2
12/10/2008 11:51:13 AM

Even using this filter to find INTC this morning at open. From 14.0 to 14.60 you made a great profit. I use $30,000 as leverage money to get more pop from the move. Nice filter Alf.

alf44
2,025 posts
msg #69749
Ignore alf44
modified
12/10/2008 12:03:42 PM

RE: FMCN

As of yesterday's Close...

FMCN showed 4 consecutive days of Range Contraction...

...yesterday was also both an NR4 & NR7...AND... a "doji" !

----------------------------------------------------------------------------

All nice set-ups for some sort of Trend Day ie... Range Expansion (today) !

Congrats, johnpaul...nice trade !


Regards,

alf44


StockFetcher Forums · Filter Exchange · Range Contraction/Expansion Filter<< 1 ... 6 7 8 9 10 ... 12 >>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