Trend Strength Indicator {Trend Strength Indicator} {for metastock, coded by P Umrysh} {from the August 2005 issue of Active Trader Magazine} PRD:= INPUT("ENTER PERIODS FOR SMA",1,100,10); STEP:= INPUT("ENTER SMA STEPS",1,50,10); A1:= IF(C > MOV(C,PRD,S),10,IF(C < MOV(C,PRD,S),-10,0)); A2:= IF(C > MOV(C,PRD+STEP,S),10, IF(C < MOV(C,PRD+STEP,S),-10,0)); A3:= IF(C > MOV(C,PRD+(STEP*2),S),10,IF(C < MOV(C,PRD+(STEP*2),S),- 10,0)); A4:= IF(C > MOV(C,PRD+(STEP*3),S),10,IF(C < MOV(C,PRD+(STEP*3),S),- 10,0)); A5:= IF(C > MOV(C,PRD+(STEP*4),S),10,IF(C < MOV(C,PRD+(STEP*4),S),- 10,0)); A6:= IF(C > MOV(C,PRD+(STEP*5),S),10,IF(C < MOV(C,PRD+(STEP*5),S),- 10,0)); A7:= IF(C > MOV(C,PRD+(STEP*6),S),10,IF(C < MOV(C,PRD+(STEP*6),S),- 10,0)); A8:= IF(C > MOV(C,PRD+(STEP*7),S),10,IF(C < MOV(C,PRD+(STEP*7),S),- 10,0)); A9:= IF(C > MOV(C,PRD+(STEP*8),S),10,IF(C < MOV(C,PRD+(STEP*8),S),- 10,0)); A10:= IF(C > MOV(C,PRD+(STEP*9),S),10,IF(C < MOV(C,PRD+(STEP*9),S),- 10,0)); A1+A2+A3+A4+A5+A6+A7+A8+A9+A10{end} Trend Strength Indicator from the August 2005 issue of Active Trader Magazine Description Looks how trendy a series is by comparing its price with various SMAs. All SMAs from PeriodStart to PeriodEnd (in steps of the Step parameter) are used for this indicator. The idea behind: The more SMAs are below (or above) the price the stronger is the trend of the price series. If some SMAs are above and some are below the price no exact trend direction can be defined. The indicator is normalized from -100 to +100, which serves as a value of how many SMAs are above or below the price: + 100 Price is above all SMAs, i.e. all SMAs are below the price > 0 Price is above most SMAs 0 Price is above 50% and below the other 50% SMAs < 0 Price is below most SMAs - 100 Price is below all SMAs, i.e. all SMAs are above the price Usually, values above 60 (below -60) indicate a strong up- (down-) trend whereas values in-between indicate a sideways market. The results depend on the period-range used for the SMAs. The broader the range (e.g. 20-200) the more significance does the indicator have. The longer the indicator remains at +/-100 the stronger the trend. Example This example uses 5 SMAs ranging from 30 to 110 in steps of 20: TrendStrengthASeries( #Close, 30, 110, 20 ); So, the indicator can return one of these values: +100 Price above all 5 SMAs + 60 Price above 4 and below 1 SMA + 20 Price above 3 and below 2 SMAs - 20 Price above 2 and below 3 SMAs - 60 Price above 1 and below 4 SMAs - 100 Price below all 5 SMAs As you can see, the indicator value changes in steps of 40. The more SMAs you use (i.e. the smaller the Step parameter) the more continual (smoother) are the resulting values. Your step-value should be small enough to get at least 10 different SMAs for indicative results.