MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Trend Strength Indicator I

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.


Trend Strength Indicator I

{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

 

Source / From: TOP
equismetastock [at] yahoogroups [dot] com  

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!