Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
Find Out More Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Schaff Trend Cycle Indicator for Metastock
kaiji
over 7 years ago
Metastock

Rating:
3 / 5 (Votes 2)
Tags:
metastock, trend

The Schaff Trend Cycle Indicator is the result of combining Slow Stochastics and the Moving Average Convergence/Divergence. The MACD is a trend indicator, yet it has lag due to its slow responsive signal line. The improved signal line gives the Schaff Trend Cycle, which acts as an early warning sign to detect trends.

MetaStock → Tools → Indicator Builder → New
Copy and paste indicator formula below.

Similar Indicators / Formulas

ADX/PDI/MDI v2.0
Submitted by MIKE1 almost 8 years ago
AWS_Consolidation
Submitted by atrader100 almost 4 years ago
BPDL Trend Filter Oscillator
Submitted by chsmcp almost 5 years ago
Adaptive Wilders Smoothing
Submitted by aashish51 almost 6 years ago
Cycle Indicator by Bill Irwin
Submitted by roszyk almost 7 years ago
Flat Market Indicator (FMI)
Submitted by chsmcp almost 5 years ago

Indicator / Formula

Copy & Paste Friendly
{ Schaff Trend Cycle Indicator v1.0 }
{ Automatic trigger levels }
{ Also see: "MACD oscillator - Schaff Trend Cycle" }
{ http://www.metastocktools.com }
{ With thanks to Tim Straiton, www.stoploss.ch }

{ variables input }
buffer:=Input("Long/Short buffer zone %",
 0,100,0)/100;
pdsCy:=Input("Schaff cycle periods",2,252,10);
pdsSh:=Input("Short periods",1,252,10);
pdsLg:=Input("Long periods",2,2520,21);

{ Schaff Trend Cycle }
MCD:=Wilders(MP(),pdsSh)-Wilders(MP(),pdsLg);
ST:=(MCD-LLV(MCD,pdsCy))
 /(HHV(MCD,pdsCy)-LLV(MCD,pdsCy))*100;
STC:=Wilders(ST,pdsCy/2);

{ Schaff Trend Cycle }
MCD:=Wilders(MP(),pdsSh)-Wilders(MP(),pdsLg);
ST:=(MCD-LLV(MCD,pdsCy))
 /(HHV(MCD,pdsCy)-LLV(MCD,pdsCy))*100;
STC:=Wilders(ST,pdsCy/2);

{ automatic trigger levels }
pk:=Ref(STC,-1)>STC AND Ref(STC,-1)>Ref(STC,-2);
pkVal:=If(pk,Ref(STC,-1),0);
pkAvg:=Cum(pkVal)/(Cum(pk)+.000001);
pkAvg:=If(pkAvg=0,100,pkAvg);
tr:=Ref(STC,-1)<STC AND Ref(STC,-1)<Ref(STC,-2);
trVal:=If(tr,Ref(STC,-1),0);
trAvg:=Cum(trVal)/(Cum(tr)+.000001);

{ STC crossover signals }
In:=Cross(pkAvg,STC);
Out:=Cross(STC,trAvg);
InInit:=Cum(In)=1;
Init:=Cum(In+Out>-1)=1;
flag:=BarsSince(Init OR In)
 < BarsSince(Init OR Out)+InInit;
signals:=(InInit AND Alert(InInit=0,2)
  OR flag AND Alert(flag=0,2))
   -(flag=0 AND Alert(flag,2));

{ trend support/resistance levels }
STCI:=If(flag,ValueWhen(1,signals,L*(1-buffer)),
 ValueWhen(1,signals=-1 OR Init,H*(1+buffer)));

{ alternative STC crossover signals method}
{bb:=BarsSince(Cross(STC,trAvg));
 bs:=BarsSince(Cross(pkAvg,STC));
 tb:=ValueWhen(1,Cross(STC,trAvg),H*(1+buffer));
 ts:=ValueWhen(1,Cross(pkAvg,STC),L*(1-buffer));
 STCI:=If(bb<bs,tb,ts);}

{ plot on price chart }
STCI

0 comments

Leave Comment

Please login here to leave a comment.

Back