StockFetcher Forums · Filter Exchange · Trend Detection Index - Long/Intermediate Term<< 1 2 >>Post Follow-up
tomm1111
202 posts
msg #69889
Ignore tomm1111
12/17/2008 2:53:58 AM

This is a filter based on the Trend Detection Index by M.H. Pee and modified. This filter is meant for long or intermediate term trading. (For those with basic sub I apologize for the cema's. I haven't tried yet, but simple moving averages probably would work in place of the cema.)

When tdi (trend detection index - blue line) crosses above 0, it indicates a trend is in place. The slope of dir (direction - green line) indicates the direction of the trend (pos slope = uptrend, neg slope = downtrend).

Also displayed is the root mean square of a double smoothed rsi(24) and it's 9 period moving average for gauge on long/intermediate term momentum direction.

This filter flags long and short entry's. An entry candidate is when "long" or "short" hits "2". Use the rms_rsi and its 9 period moving average to validate the trade.

Fetcher[
/* Trend Detection Index */
set{a2c,close - close 10 days ago}
set{DIR,sum(a2c,10)}
set{AV,abs(DIR)}

set{amc,abs(a2c)}
set{SAM_h,sum(amc,20)}
set{SAM_l,sum(amc,10)}

set{pre,SAM_h - SAM_l}
set{TDI,AV - pre}

draw TDI
draw TDI line at 0
draw DIR on plot TDI

/* Long - Short Criteria */
set{z1,count(TDI crossed above 0,1)}
set{l_c,count(DIR is greater than DIR 1 day ago,1)}
set{s_c,count(DIR is less than DIR 1 day ago,1)}

set{long,z1 + l_c}
set{short,z1 + s_c}

draw long
draw short on plot long

/* Calculate root mean square - pre-smoothing */
set{my_rms,cema(rsi(24),5)}
set{dbl,cema(my_rms,5)}
set{var,pow(dbl,2)}
set{var1,sum(var,2)}
set{var2,var1/2}
set{rms_rsi,pow(var2,0.5)}

set{mov_ave,cema(rms_rsi,9)}

draw rms_rsi
draw mov_ave on plot rms_rsi

show stocks where close is above 1
and volume is above 100000
and chart-time is 1 year

add column separator
add column long
add column short
add column separator
add column TDI{trend detection index}
add column DIR{trend direction}
add column separator

sort by column 6 descending
]



tomm1111
202 posts
msg #69890
Ignore tomm1111
12/17/2008 3:10:23 AM

I got rid of those pesky cema's and replaced them with cma's. This version might work with the basic subscription. I'm not sure, if someone can test. Anyone...anyone....Bueller...Chetron...anyone...!?

Fetcher[

/* Trend Detection Index */
set{a2c,close - close 10 days ago}
set{DIR,sum(a2c,10)}
set{AV,abs(DIR)}

set{amc,abs(a2c)}
set{SAM_h,sum(amc,20)}
set{SAM_l,sum(amc,10)}

set{pre,SAM_h - SAM_l}
set{TDI,AV - pre}

draw TDI
draw TDI line at 0
draw DIR on plot TDI

/* Long - Short Criteria */
set{z1,count(TDI crossed above 0,1)}
set{l_c,count(DIR is greater than DIR 1 day ago,1)}
set{s_c,count(DIR is less than DIR 1 day ago,1)}

set{long,z1 + l_c}
set{short,z1 + s_c}

draw long
draw short on plot long

/* Calculate root mean square - pre-smoothing */
set{my_rms,cma(rsi(24),5)}
set{dbl,cma(my_rms,5)}
set{var,pow(dbl,2)}
set{var1,sum(var,2)}
set{var2,var1/2}
set{rms_rsi,pow(var2,0.5)}

set{mov_ave,cma(rms_rsi,9)}

draw rms_rsi
draw mov_ave on plot rms_rsi

show stocks where close is above 1
and volume is above 100000
and chart-time is 1 year

add column separator
add column long
add column short
add column separator
add column TDI{trend detection index}
add column DIR{trend direction}
add column separator

sort by column 6 descending
]



mystiq
650 posts
msg #69892
Ignore mystiq
12/17/2008 5:46:12 AM

==>Tested it: -->Your StockFetcher filter exceeds filter performance restrictions.
To run this filter, please upgrade to the StockFetcher Advanced subscription level.
If you feel that you have reached this message in error, please contact StockFetcher Support. Be sure to include the text of this filter when contacting support.
For more information on Advanced Filter Support, please click here. --->Is the result<---


chetron
2,817 posts
msg #69893
Ignore chetron
12/17/2008 6:50:54 AM

you are just getting too sophisticated tomm. the mass' are going to have to make do.
: )


tomm1111
202 posts
msg #69897
Ignore tomm1111
12/17/2008 10:15:15 AM

Thanks for testing. Give this one a try. It should work now as I removed the smoothed rsi. The hits to go long or short are the same as the filters above.

Fetcher[
/* Trend Detection Index */
set{a2c,close - close 10 days ago}
set{DIR,sum(a2c,10)}
set{AV,abs(DIR)}

set{amc,abs(a2c)}
set{SAM_h,sum(amc,20)}
set{SAM_l,sum(amc,10)}

set{pre,SAM_h - SAM_l}
set{TDI,AV - pre}

draw TDI
draw TDI line at 0
draw DIR on plot TDI

/* Long - Short Criteria */
set{z1,count(TDI crossed above 0,1)}
set{l_c,count(DIR is greater than DIR 1 day ago,1)}
set{s_c,count(DIR is less than DIR 1 day ago,1)}

set{long,z1 + l_c}
set{short,z1 + s_c}

draw long
draw short on plot long

show stocks where close is above 1
and volume is above 100000
and chart-time is 1 year

add column separator
add column long
add column short
add column separator
add column TDI{trend detection index}
add column DIR{trend direction}
add column separator

sort by column 6 descending
]



chetron
2,817 posts
msg #69900
Ignore chetron
12/17/2008 11:06:52 AM

STILL NOTHIN', WOW. THIS IS A TOUGH ONE.



marine2
963 posts
msg #69908
Ignore marine2
12/17/2008 6:50:46 PM

Create this filters intention on the basic version of Stock Fetcher. Thanking you in advance.

tomm1111
202 posts
msg #69911
Ignore tomm1111
12/17/2008 9:59:00 PM

I'll try another approach at it if I can think of a way. I don't understand why the latest version doesn't work. The only thing I can think of is the "abs" function that I can't understand why it wouldn't work on the basic sub. Does anyone know if the "abs" function works on the basic sub??

I'm at a disadvantage on testing since I don't know what doesn't work or not.

I can post a picture on what it looks like. Do you need online storage of images to link them in to forum messages?

tomm1111
202 posts
msg #69915
Ignore tomm1111
modified
12/18/2008 1:27:57 AM

I reduced the filter by 1 line. This is as simple as it can get.


Fetcher[
/* Trend Detection Index */
set{a2c,close - close 10 days ago}
set{DIR,sum(a2c,10)}

set{amc,abs(a2c)}
set{SAM_h,sum(amc,20)}
set{SAM_l,sum(amc,10)}

set{pre,SAM_h - SAM_l}
set{TDI,abs(DIR) - pre}

draw TDI
draw TDI line at 0
draw DIR on plot TDI

/* Long - Short Criteria */
set{z1,count(TDI crossed above 0,1)}
set{l_c,count(DIR is greater than DIR 1 day ago,1)}
set{s_c,count(DIR is less than DIR 1 day ago,1)}

set{long,z1 + l_c}
set{short,z1 + s_c}

draw long
draw short on plot long

show stocks where close is above 1
and volume is above 100000
and chart-time is 1 year

add column separator
add column long
add column short
add column separator
add column TDI{trend detection index}
add column DIR{trend direction}
add column separator

sort by column 6 descending
]



mystiq
650 posts
msg #69918
Ignore mystiq
12/18/2008 6:31:13 AM

----again, same thing:--> Your StockFetcher filter exceeds filter performance restrictions.
To run this filter, please upgrade to the StockFetcher Advanced subscription level.
If you feel that you have reached this message in error, please contact StockFetcher Support. Be sure to include the text of this filter when contacting support.
For more information on Advanced Filter Support, please click here (-.-)


StockFetcher Forums · Filter Exchange · Trend Detection Index - Long/Intermediate Term<< 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.