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 #

Schaff Trend Cycle Indicator by Jose Silva

????????: Kalon , ?? , 05 ???? 2004 ? 20:22 MSK

Hello,
Below is the Schaff trend Cycles Indicator for Metastok. Can someone tranfer it for Omega format (els or ela). There is a text file in tradestationworld.com forum but seems like it does not displays well on Omega 2000i.
Thanks a lot.


Schaff Trend Cycle Indicator v1.0


{ Automatic trigger levels }
{ Also see:
"MACD oscillator - Schaff Trend Cycle" }
{ josesilva22@yahoo.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

 

Source / From: TOP
http://www.fxo.ru/forum-2/messages/91531.html

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!