StockFetcher Forums · Filter Exchange · Trend Intensity Index<< >>Post Follow-up
tomm1111
202 posts
msg #69734
Ignore tomm1111
12/10/2008 12:52:40 AM

Taken from a S&C article (June2002) by M.H Pee and modified (of course!). The Trend Intensity Index (TII) is used to indicate the strength of a current trend in the market. I modified the TII to indicate long or short positions. Going from 0 to 100 is long and 100 to 0 is short. This is works in progress. Working on other criteria to reduce hit rate and improve quality.

(Chetron, I think this works in the nose bleed section, but I'm not 100% sure.)

Fetcher[
/* Trend Intensity Index */
set{calc_ma,cma(close,10)}

set{sdp1,close - calc_ma}
set{varp,0}
set{sdp2,max(sdp1,varp)}
set{sdp,sum(sdp2,1)}

set{sdn1,calc_ma - close}
set{varn,0}
set{sdn2,max(sdn1,varn)}
set{sdn,sum(sdn2,1)}

set{sdc,sdn + sdp}
set{sdc1,sdp / sdc}
set{TII,sdc1 * 100}

draw TII

show stocks where close is above 1
and volume is above 100000

add column TII
]



chetron
2,817 posts
msg #69739
Ignore chetron
modified
12/10/2008 6:40:35 AM

THANX TOMM!

MAYBE...

Fetcher[

/* GOING LONG */

/* Trend Intensity Index */
set{calc_ma,cma(close,10)}

set{sdp1,close - calc_ma}
set{varp,0}
set{sdp2,max(sdp1,varp)}
set{sdp,sum(sdp2,1)}

set{sdn1,calc_ma - close}
set{varn,0}
set{sdn2,max(sdn1,varn)}
set{sdn,sum(sdn2,1)}

set{sdc,sdn + sdp}
set{sdc1,sdp / sdc}
set{TII,sdc1 * 100}

draw TII
DRAW SDP1
DRAW SDP
DRAW SDN1
DRAW SDN

show stocks where close is above 1
and volume is above 100000

add column TII


]



snappyfrog
653 posts
msg #157886
Ignore snappyfrog
10/15/2021 3:30:03 PM

Anyone else want to give this a try???



The Trend intensity index (TII) indicator measures the strength of a trend in the market.
It compares the price of the last 30 days to the 60-day moving average.
M.H. Pee developed the Trend intensity index (TII) indicator to measure the strength of a trend in the market. It uses the current 60-day moving average for the measurements. TII looks at the proportion of prices of prior 30 days being above or below today’s 60-day moving average. The purpose of the TII indicator’s measurements is to gauge the future price trend movement.

The TII indicator takes today’s 60-day moving average and each day’s deviation (close – average). Up deviations give a positive amount while the downside deviations give negative amounts.

Up = close – average

Down = average- close

Now, the trend intensity index is the percentage of the total up amount out of the total up and down amounts. The formula is:

Trend intensity index (TII) = {total up / (total up + total down)} × 100

The trend intensity index indicator ranges between two values 0 and 100. The value beyond 50 indicates a bullish trend while the TII indicator’s values below 50 indicate a bearish trend. The distance from the 50 points is also a measure of the trend’s strength. The TII values near 80 mean a strong bullish trend while the values near 20 suggest a strong bearish trend.

The TII buy strategy involves the following steps.

The signal line crossing from above the TII line.
The price is above the SMA 50 while the TII value is near 20.
Place stop-loss near swing low.
Take profit may also be the same size as a stop-loss.
The TII sell strategy involves the following steps.

The signal line crossing from below the TII line.
The price is below the SMA 50 while the TII value is near 80.
Place stop-loss near swing high.
Take profit may also be the same size as a stop-loss.


Moreover, if traders want to enter a long position in the next trading session, the TII should be above 80. Conversely, if traders want to enter a short position in the next trading session, the TII needs to be below the 20 points mark. However, the trend intensity index indicator is a quite simple indicator and it is always recommended to use it in conjunction with any other technical analysis tools. It will always be a fruitful strategy to enter the trade when the signals of each indicator confirm each other.


Cheese
1,374 posts
msg #157888
Ignore Cheese
10/15/2021 8:01:06 PM

snappy, maybe something like this?

Fetcher[
/* https://www.stockfetcher.com/forums/Filter-Exchange/Trend-Intensity-Index/69734 */

symlist(XLB,XLC,XLE,XLF,XLI,XLK,XLP,XLRE,XLU,XLV,XLY,SPY,QQQ,IWM,DIA,UUP)
chart-time 24 months
chart-type OHLC

draw ma(50)

set{diff_up,close - ma(20)} /* ma(20) seems more timely than ma(60) */
set{count_up,count(diff_up > 0,1)}
set{sum_count_up,sum(count_up,30)} /* over last 30 days */

set{TII_MHPee, sum_count_up / 30} /* over last 30 days */
set{TII_MHPee100,100 * TII_MHPee}

draw TII_MHPee100 line at 80
draw TII_MHPee100 line at 20
draw TII_MHPee100 line at 50

add column TII_MHPee100

set{buy1,count(close > ma(50),1)}
set{buy2,count(TII_MHPee100 near 20,1)}
set{buy,buy1+buy2}
draw buy

set{sell1,count(close < ma(50),1)}
set{sell2,count(TII_MHPee100 near 80,1)}
set{sell,sell1+sell2}
draw sell
]




Cheese
1,374 posts
msg #157889
Ignore Cheese
10/15/2021 8:03:46 PM

with ma(60)

Fetcher[
/* https://www.stockfetcher.com/forums/Filter-Exchange/Trend-Intensity-Index/69734 */

symlist(XLB,XLC,XLE,XLF,XLI,XLK,XLP,XLRE,XLU,XLV,XLY,SPY,QQQ,IWM,DIA,UUP)
chart-time 24 months
chart-type OHLC

draw ma(50)

set{diff_up,close - ma(60)}
set{count_up,count(diff_up > 0,1)}
set{sum_count_up,sum(count_up,30)} /* over last 30 days */

set{TII_MHPee, sum_count_up / 30} /* over last 30 days */
set{TII_MHPee100,100 * TII_MHPee}

draw TII_MHPee100 line at 80
draw TII_MHPee100 line at 20
draw TII_MHPee100 line at 50

add column TII_MHPee100

set{buy1,count(close > ma(50),1)}
set{buy2,count(TII_MHPee100 near 20,1)}
set{buy,buy1+buy2}
draw buy

set{sell1,count(close < ma(50),1)}
set{sell2,count(TII_MHPee100 near 80,1)}
set{sell,sell1+sell2}
draw sell
]



snappyfrog
653 posts
msg #157893
Ignore snappyfrog
10/18/2021 8:35:06 AM

Thanks Cheese, I like the second one better using the ma60. I am playing with different buy and sell points, adding some of my tweaks to this setup. May just be another rabbit hole, but we'll see.

snappyfrog
653 posts
msg #157894
Ignore snappyfrog
10/18/2021 9:42:00 AM

I made some adjustments on the chetron filter above. Now
what I need is the SDP1 set as a range oscillator between 0 and 100
so I am not using 22 day high / low to find buy / sell signals.

I know I've seen how to do this before, but can't find it.

Fetcher[
/* GOING LONG */

/* Trend Intensity Index */
set{calc_ma,cma(close,60)}

set{sdp1,close - calc_ma}
set{varp,0}
set{sdp2,max(sdp1,varp)}
set{sdp,sum(sdp2,1)}

set{sdn1,calc_ma - close}
set{varn,0}
set{sdn2,max(sdn1,varn)}
set{sdn,sum(sdn2,1)}

set{sdc,sdn + sdp}
set{sdc1,sdp / sdc}
set{TII,sdc1 * 100}

draw TII
DRAW SDP1 22 day low on plot SDP1
DRAW SDP1 22 day high on plot SDP1
/*DRAW SDP
DRAW SDN1 22 day high on plot SDN1
DRAW SDN*/

show stocks where close is above 1
and volume is above 100000

add column TII

and draw high 22 day high on plot price
]



Cheese
1,374 posts
msg #157895
Ignore Cheese
10/18/2021 9:51:22 AM

maybe something like this

Fetcher[
/* https://www.stockfetcher.com/forums/Filter-Exchange/Trend-Intensity-Index/69734 */

/* GOING LONG */

/* Trend Intensity Index */
set{calc_ma,cma(close,60)}

set{sdp1,close - calc_ma}
set{varp,0}
set{sdp2,max(sdp1,varp)}
set{sdp,sum(sdp2,1)}

set{sdn1,calc_ma - close}
set{varn,0}
set{sdn2,max(sdn1,varn)}
set{sdn,sum(sdn2,1)}

set{sdc,sdn + sdp}
set{sdc1,sdp / sdc}
set{TII,sdc1 * 100}

draw TII
DRAW SDP1 22 day low on plot SDP1
DRAW SDP1 22 day high on plot SDP1
/*DRAW SDP
DRAW SDN1 22 day high on plot SDN1
DRAW SDN*/

set{SDP1%, 100 * INDPOSITION(SDP1,100)} /* EDIT */
DRAW SDP1% LINE AT 80 /* EDIT */
DRAW SDP1% LINE AT 20 /* EDIT */
DRAW SDP1% LINE AT 50 /* EDIT */

show stocks where close is above 1
and volume is above 100000

add column TII

and draw high 22 day high on plot price





]



snappyfrog
653 posts
msg #157897
Ignore snappyfrog
10/18/2021 10:19:39 AM

Excellent Cheese, thank you!

StockFetcher Forums · Filter Exchange · Trend Intensity Index<< >>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.