StockFetcher Forums · Filter Exchange · Help with this filter<< 1 2 >>Post Follow-up
Cheese
1,374 posts
msg #154448
Ignore Cheese
10/27/2020 1:19:37 AM


Graf,
How does this list of picks compare to yours?

Fetcher[
/* https://www.stockfetcher.com/forums/Filter-Exchange/Help-with-this-filter/154407 */
/* graftonian 10/22/2020 2:58:21 PM */
/* graftonian 10/23/2020 7:32:25 PM */

/*Hull Moving average cross/ Schaff Trend Cycle/ Volume increase
****************************Basic Criteria*********************/
not OTCBB
average volume(30) greater than 50000
close between .50 and 200
close greater than close 1 day ago
sort on column 5 descending
/**********************The Rules*****************
Buy on the first current occurance of Trigger = 3
Sell on Price cross below H50 or Price below 3 day count back line,
whichever is higher.
/*****************************HULL50MA***********************/
set{slow1, cwma(close, 25)}
set{slow2, 2 * slow1}
set{slow3, cwma(close, 50)}
set{valslow, slow2 - slow3}
set{H50, cwma(valslow, 7)}
DRAW H50 ON PLOT PRICE
/******************************HULL10MA**********************/
set{slow1A, cwma(close, 5)}
set{slow2A, 2 * slow1A}
set{slow3A, cwma(close, 10)}
set{valslowA, slow2A - slow3A}
set{H10, cwma(valslowA, 3)}
DRAW H10 ON PLOT PRICE
/*********************SCHAFF TREND CYCLE**********************/
/*
set{range, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{var2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{var3, var2 / range}
set{var6, cema(var3, 3) 10 day high}
set{var5, cema(var3, 3) 10 day low}
set{var7, cema(var3, 3) - var5}
set{var8, var6 - var5}
set{var9, var7 / var8}
set{var10, cema(var9, 3)}
set{STC, 100 * var10}
draw STC
draw STC line at 25
draw STC line at 75
*/

/* partial STC code by olathegolf */
/* https://www.stockfetcher.com/forums/Filter-Exchange/THE-SCHAFF-TREND-CYCLE-INDICATOR/95838/-1/96104 */
set{var1, ema(23) - ema(50)}
set{highest, var1 20 day high}
set{lowest, var1 20 day low}
set{range, highest - lowest}
set{var2, var1 - lowest}
set{var3, var2 / range}
set{var4, var3 * 100}
set{stc , cema(var4, 5)}
add column stc
draw stc line at 75
draw stc line at 25
draw ema(23)

/******************Volume % above 30 day average**************/
set{VolX, volume / CWMA(volume, 21)}
draw CWMA(volume, 21)

/*********HullMA cross count*****/
set{HullCrossCount, count(H10 above H50, 1)}
/* draw HullCrossCount */
/******STC crossed 25 count******/
set{STCcrosscount, count(STC above 25, 1)}
/* draw STCcrosscount */
/**********Volume % count********/
set{VolCount, count(VolX greater than 1.2, 1)}
/* draw VolCount */
/************Sum the count calculations (trigger)**************/
set{trig1, HullCrossCount + STCcrosscount}
/* set{trigger, trig1 + VolCount} */
/******Display results********/
add column trig1
add column VolCount
/* trigger equals 3 */
H10 above H50
STC above 25
VolX greater than 1.2
do not draw trigger
]




graftonian
1,089 posts
msg #154452
Ignore graftonian
10/27/2020 9:05:13 AM

Fetcher[
market is not OTCBB
/***********The STC section you posted*************/
set{var1, ema(23) - ema(50)}
set{highest, var1 20 day high}
set{lowest, var1 20 day low}
set{range, highest - lowest}
set{var2, var1 - lowest}
set{var3, var2 / range}
set{var4, var3 * 100}
set{stc , cema(var4, 5)}
add column stc
draw stc line at 75
draw stc line at 25
/*********************My SCHAFF TREND CYCLE**********************/
set{myrange, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{myvar2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{myvar3, myvar2 / myrange}
set{myvar6, cema(myvar3, 3) 10 day high}
set{myvar5, cema(myvar3, 3) 10 day low}
set{myvar7, cema(myvar3, 3) - myvar5}
set{myvar8, myvar6 - myvar5}
set{myvar9, myvar7 / myvar8}
set{myvar10, cema(myvar9, 3)}
set{MySTC, 100 * myvar10}
draw MySTC on plot STC
]



nibor100
1,044 posts
msg #154453
Ignore nibor100
10/27/2020 10:52:47 AM

@Graftonian,

I'm still working with the original filter you posted in this thread and have come up with an approximate 80% solution, shown in the filter down below.

1. To reduce complexity I've changed your trigger from a 3 part trigger to a 2 part trigger without the STC component.

Then I added the STC component check back in by using this line:

add column stccrosscount equals 1

Then to show the new stocks that meet your 3 trigger criteria I added the following 2 lines:

add column trigger 1 day ago
sort on column 7 ascending

So the only thing missing from my modified filter is the check of which stocks met the STC component today that did not meet it yesterday so they also would be included at the top of the list. I'm guessing that means about 20% of the new stocks are co-mingled in the sort column in those stocks that have the number 2.

2. Bottom line is my modified filter finds all of the same stocks and stacks many of the first timers at the top of the list but is co-mingling some of the first timers in the lower part of the list, but it should help you some. and I plan to work a little more on it before I give up entirely.

Ed S.

Fetcher[
/*Hull Moving average cross/ Schaff Trend Cycle/ Volume increase
****************************Basic Criteria*********************/
not OTCBB
average volume(30) greater than 50000
close between .50 and 200
close greater than close 1 day ago
/*sort on column 5 descending*/
/**********************The Rules*****************
Buy on the first current occurance of Trigger = 3
Sell on Price cross below H50 or Price below 3 day count back line,
whichever is higher.
/*****************************HULL50MA***********************/
set{slow1, cwma(close, 25)}
set{slow2, 2 * slow1}
set{slow3, cwma(close, 50)}
set{valslow, slow2 - slow3}
set{H50, cwma(valslow, 7)}
DRAW H50 ON PLOT PRICE
/******************************HULL10MA**********************/
set{slow1A, cwma(close, 5)}
set{slow2A, 2 * slow1A}
set{slow3A, cwma(close, 10)}
set{valslowA, slow2A - slow3A}
set{H10, cwma(valslowA, 3)}
DRAW H10 ON PLOT PRICE
/*********************SCHAFF TREND CYCLE**********************/
/*set{range, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{var2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{var3, var2 / range}
set{var6, cema(var3, 3) 10 day high}
set{var5, cema(var3, 3) 10 day low}
set{var7, cema(var3, 3) - var5}
set{var8, var6 - var5}
set{var9, var7 / var8}
set{var10, cema(var9, 3)}
set{STC, 100 * var10}*/
set{range, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{var2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{var3, var2 / range}
set{var7, cema(var3, 3) - cema(var3, 3) 10 day low}
set{var8, cema(var3, 3) 10 day high - cema(var3, 3) 10 day low}
set{var9, var7 / var8}
set{var10, cema(var9, 3)}
set{stc, 100 * var10}
draw STC
draw STC line at 25
draw STC line at 75
/******************Volume % above 30 day average**************/
set{VolX, volume / CWMA(volume, 21)}
draw CWMA(volume, 21)

/*********HullMA cross count*****/
set{HullCrossCount, count(H10 above H50, 1)}
draw HullCrossCount
/******STC crossed 25 count******/
set{STCcrosscount, count(cema(var9, 3) above .25, 1)}
draw STCcrosscount
/**********Volume % count********/
set{VolCount, count(VolX greater than 1.2, 1)}
draw VolCount
/************Sum the count calculations (trigger)**************/
set{trig1, HullCrossCount + STCcrosscount}
/*set{trigger, trig1 + VolCount}*/
set{trigger, HULLCROSSCOUNT + VolCount}
/******Display results********/
add column trigger
/*trigger equals 3*/
trigger equals 2
/*add column trigger 1 day ago*/
do not draw trigger

add column stccrosscount equals 1
add column trigger 1 day ago
sort on column 7 ascending
]



nibor100
1,044 posts
msg #154455
Ignore nibor100
10/27/2020 12:14:08 PM

@ MAC and CHEESE, (I couldn't resist :)

Here is the link to the PDF from the Schaff Trend Cycle originator:

https://www.omnitrader.com/currentclients/proforum/get-attachment.asp?attachmentid=2503

There is a double use of Stochastics on the MACD in his original implementation.

Ed S.

Cheese
1,374 posts
msg #154457
Ignore Cheese
10/27/2020 1:13:12 PM

haha
Thanks, Ed

Yes, I know that the STC that you and graftonian developed using MACD
is the correct one, and it does reconcile with the STC on other platforms.

The STC that other sF members developed using only EMAs is not good
enough for STC purists. But for basic subs who don't need to reconcile
the STC values, then the "STC using EMAs" can give us a rough idea.

Mactheriverrat
3,157 posts
msg #154467
Ignore Mactheriverrat
10/27/2020 10:59:11 PM

Well I just threw my code out there. I'm not really that crazy about it.

graftonian
1,089 posts
msg #154483
Ignore graftonian
10/28/2020 5:50:45 PM

Both the original and modified STC codes picked ZDGE, a bright spot in a sea of red.

nibor100
1,044 posts
msg #154486
Ignore nibor100
10/29/2020 2:46:25 AM

@ Cheese, Graftonian,

It appears to me your comparisons are not quite fair as each filter is using different parameters than the other such as different length moving averages.

I've modified Graf's comparison filter below so basic parameters are equal, and it appears in many cases there is only a slight difference, yet still significant differences in many others.

Ed S.

Fetcher[
market is not OTCBB
/***********The STC section you posted*************/
set{var1, ema(23) - ema(50)}
set{highest, var1 10 day high}
set{lowest, var1 10 day low}
set{range, highest - lowest}
set{var2, var1 - lowest}
set{var3, var2 / range}
set{var4, var3 * 100}
set{stc , cema(var4, 3)}
add column stc
draw stc line at 75
draw stc line at 25
/*********************My SCHAFF TREND CYCLE**********************/
set{myrange, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{myvar2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{myvar3, myvar2 / myrange}
set{myvar6, cema(myvar3, 3) 10 day high}
set{myvar5, cema(myvar3, 3) 10 day low}
set{myvar7, cema(myvar3, 3) - myvar5}
set{myvar8, myvar6 - myvar5}
set{myvar9, myvar7 / myvar8}
set{myvar10, cema(myvar9, 3)}
set{MySTC, 100 * myvar10}
draw MySTC on plot STC
]



graftonian
1,089 posts
msg #154490
Ignore graftonian
10/29/2020 9:30:45 AM

Perhaps IFT(5,9) is a better substitute for STC, and it is a canned function.

Fetcher[
chart-time is 1 year
market is not OTCBB
draw EMA(200)
20 day slope of EMA(200) > 0
add column 20 day slope of EMA(200)
sort on column 5 descending
/*schaff trend cycle*/
set{range, MACD (23,50,9) 10 day high - MACD (23,50,9) 10 day low}
set{var2, MACD (23,50,9) - MACD (23,50,9) 10 day low}
set{var3, var2 / range}
set{var6, cema(var3, 3) 10 day high}
set{var5, cema(var3, 3) 10 day low}
set{var7, cema(var3, 3) - var5}
set{var8, var6 - var5}
set{var9, var7 / var8}
set{var10, cema(var9, 3)}
set{STC, 100 * var10}
add column separator
draw STC and draw stc line at 25 and draw STC line at 75
STC crossed above 25
set{IN, close}
draw price line at IN
set{10pct, IN * 1.10}
draw price line at 10pct
set{5stop, IN *.95}
draw price line at 5stop
add column separator
set{VolX, volume / Average Volume(30)}
add column VolX
VolX > 1.05
do not draw VolX
draw IFT(5,9)
]




Cheese
1,374 posts
msg #154493
Ignore Cheese
10/29/2020 10:48:01 AM

@ nibor100 and graftonian

Thank you for coding your MACD-based STC and your IFT(5,9) ideas.

Your MACD-based STC is true to Doug Schaff's intentions.compared to the EMA-based "STC".
Your MACD-based STC correctly reflects the values and threshold levels.

Although the EMA-based STC is mainly a workaround for basic subs,
its smoother, rounder gradual move may have appeal to some,
compared to the sharper edges of the MACD-based STC.

StockFetcher Forums · Filter Exchange · Help with this filter<< 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.