PureBytes Links
Trading Reference Links
|
Here is some applications.
/*Analytic RSI of an Array with fixed period*/t=14;//
fixed periodVar=C;// variable
arrayUp=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Ut=Wilders(Up,t);Dt=Wilders(Dn,t);RSIvar=100*(Ut/(Ut+Dt));//
the RSI of an array with fixed
periodPlot(RSIvar,"",1,1);Plot(RSI(t),"",2,2);//
verification1Plot(RSIA(Var,t),"",4,8);// verification2
/*Analytic RSI of an Array with variable
period*/Tvar=14;// variable periodVar=C;// variable
arrayUp=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Ut1=AMA(Up,1/Tvar);Dt1=AMA(Dn,1/Tvar);RSIvar1=100*(Ut1/(Ut1+Dt1));//
the RSI of an array with variable
periodPlot(RSIvar1,"",4,8);Plot(RSI(14),"",2,2);//
verification
Application1: the RSI of Close when period varies from 14 to
28
Tvar=14+Cum(1)%15;// variable period from 14 to 28Var=C;//
variable
arrayUp=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Ut1=AMA(Up,1/Tvar);Dt1=AMA(Dn,1/Tvar);RSIvar1=100*(Ut1/(Ut1+Dt1));//
the RSI of an array with variable
periodPlot(RSIvar1,"",4,8);Plot(RSI(14),"",2,1);// comparison with
RSI(14)
Application2 : The RSI of StochD(20) with variable period from
14 to 28
Tvar=14+Cum(1)%15;// variable period from 14 to
28Var=StochD(20);// variable
arrayUp=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Ut1=AMA(Up,1/Tvar);Dt1=AMA(Dn,1/Tvar);RSIvar1=100*(Ut1/(Ut1+Dt1));//
the RSI of an array with variable periodPlot(RSIvar1,"",1,8);
Tvar=14;// fixed periodVar=StochD(20);// variable
arrayUp=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);Ut1=AMA(Up,1/Tvar);Dt1=AMA(Dn,1/Tvar);RSIvar2=100*(Ut1/(Ut1+Dt1));//
the RSI of an array with fixed periodPlot(RSIvar2,"",4,8);
Since we read urgent requests for this subject, use
temporarily these AFL solutions until Tomasz will add similar subjects
to
official editions/upgrades.
----- Original Message -----
From: <A
href="" title=tsokakis@xxxxxxxxx>Dimitris Tsokakis
To: <A href=""
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx
Sent: Saturday, April 19, 2003 2:04 PM
Subject: Smoothing Factors
Any EMA or Wilders smoothing may contain variable period
through AMA smoothing.
We just need some relations, posted many times in this
list.
Save somewhere the IB code for further reference
<FONT
color=#000000>
Wilderssmooth=14<FONT face=Verdana
size=2><FONT
face="Times New Roman">;
EMAsmooth=2<FONT
size=2>*Wilderssmooth-1<FONT
size=2>;
AMAsmooth=2<FONT
size=2>/(EMAsmooth+1<FONT face=Verdana
size=2>);<FONT
face=Verdana size=2>
Plot(Wilders<FONT
size=2>(C,Wilderssmooth),"",<FONT
size=2>1,1<FONT face=Verdana
size=2>);<FONT
face=Verdana size=2>
Plot(EMA<FONT
size=2>(C,EMAsmooth),"",<FONT
size=2>4,8<FONT face=Verdana
size=2>);<FONT
face=Verdana size=2>
Plot(AMA<FONT
size=2>(C,AMAsmooth),"",<FONT
size=2>2,2<FONT face=Verdana
size=2>);
you will verify that
after the 2*t first bars the tree plots coincide [with a second decimal
accuracy]
and we can call them
the same thing.
Consequently, any
T/A formula including EMA [like MACD] or Wilders [like RSI] smoothing may be
equivalent
to an AMA formula,
which accepts variable period by default.
Since MA, DEMA and
TEMA also accept variable period, I do not see any smoothing procedure missing
in AFL
<FONT
face="Times New Roman">structure.
Dimitris
Tsokakis
Yahoo! Groups Sponsor
ADVERTISEMENT
<img
src="" width=300 height=250 border=0>
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|