// 1.st RSI under inverse fisher tansform
//for references , please see STocks & Commodities article, october 2010, "A smoothed RSI Invers Fisher Transform"
// In general, y is the inverse fisher transform
// y=(exp(2*x)-1)/(Exp(2*x)+1)
// where x is the original function
// range of the indicator is [-5, +5]
// variable: n and m (period of "transformation")
x= 0.1*(RSI[n](close)-50)
// in this case, x is actually an "intermediate" function between RSI and RSInorm
// default n = 5 , m = 9
y=(exp(2*x)-1)/(Exp(2*x)+1)
RSInorM=50*(y+1)
EMAinvfish=ExponentialAverage[m](RSInorm)
Sum=RSInorm+Emainvfish
// now ARSI - Version 1. Pro Real Time formula
// for references, please see for article: STock & Commodities, V. 26:10 ARSI The Asymmetrical RSI by Sylvain Vervoort.
// for formula, see below (amibroker language)
//dayscounter=dc
upcount = 0
j = 2
for i = 1 to n do
if close[i]>=close[j] then
upcount = upcount + 1
else
upcount=upcount+0
endif
j=j+1
next
dncount=n-upcount
k1u=upcount*2-1
k1d=dncount*2-1
k1uu=max(k1u,0.1)
k1dd=max(k1d,0.1)
k2d=-dncount
h1u=max(upcount,1)
h1d=max(k2d,1)
// this (0.1 and 1) because exponential average needs real strictly positive numbers
UpMove=ExponentialAverage[k1uu](h1u)
DnMove=ExponentialAverage[k1dd](h1d)
RS = UpMove/DnMove
ARSI = 100-(100/(1+RS))
// Version 1.
// ARSI formula
// constant period version (looks into the future)
// used also amibroker language translated to Pro Real Time language (since Stock & Commodities article is difficult to understand)
// (u) Period = Param("ARSI Period", 14, 1, 100 );
//(u) Chg = C - Ref( C, -1 );
// (u) UpCount = Sum( Chg >= 0, Period );
// (u) DnCount = Period - UpCount;
//(u) UpMove = EMA( Max( Chg, 0 ), SelectedValue( UpCount) * 2 - 1 );
// DnMove = EMA( Max( -Chg, 0 ), SelectedValue( DnCount ) * 2 - 1 );
// RS = UpMove/DnMove;
//(u) ARSI = 100-(100/(1+RS));
//(u) Plot( ARSI, "ARSI("+Period+")", colorBlue )
// Version 2.
// ARSI formula
// variable period version (backtest-safe)
//(u) = part not implemented yet
// (u) Period = Param("ARSI Period", 14, 1, 100 );
//(u) Chg = C - Ref( C, -1 );
// (v) UpCount = Sum( Chg >= 0, Period );
// (v) DnCount = Period - UpCount;
// (v) UpMove = AMA( Max( Chg, 0 ), 1/UpCount );
// (v) DnMove = AMA( Max( -Chg, 0 ), 1/DnCount );
//(v) RS = UpMove/DnMove;
//(v) ARSI = 100-(100/(1+RS));
//(v) Plot( ARSI, "ARSI_V("+Period+")", colorGreen );
//(v) Plot( RSI( Period ), "RSI", colorRed );
return ARSI coloured (0, 0, 255) as "ARSI", RSInorm as "RSInorm", EMAinvfish coloured (0, 255, 0) as "EMAinvfish", sum coloured (255, 0, 0) as "Sum"
*******************
Results:
- ARSI version 2 has not been developed (since ARSI seems just more a tendency line than an indicator, maybe because of the limite of Pro Real Time trading desk)
- This group of lines cannot be used for trading (different false signals when they open or when crossing ARSI), but also for confirming a state of market (brought to bear or bull), which can be understood also by the lecture of other indicators (supertrend, vortex, random walk...)
- this group of indicator is too hysterical
These results don't change with a different time frame ==> Conclusion: removed form the desk
see images below
guardare le immagini sotto
Any source
//for references , please see STocks & Commodities article, october 2010, "A smoothed RSI Invers Fisher Transform"
// In general, y is the inverse fisher transform
// y=(exp(2*x)-1)/(Exp(2*x)+1)
// where x is the original function
// range of the indicator is [-5, +5]
// variable: n and m (period of "transformation")
x= 0.1*(RSI[n](close)-50)
// in this case, x is actually an "intermediate" function between RSI and RSInorm
// default n = 5 , m = 9
y=(exp(2*x)-1)/(Exp(2*x)+1)
RSInorM=50*(y+1)
EMAinvfish=ExponentialAverage[m](RSInorm)
Sum=RSInorm+Emainvfish
// now ARSI - Version 1. Pro Real Time formula
// for references, please see for article: STock & Commodities, V. 26:10 ARSI The Asymmetrical RSI by Sylvain Vervoort.
// for formula, see below (amibroker language)
//dayscounter=dc
upcount = 0
j = 2
for i = 1 to n do
if close[i]>=close[j] then
upcount = upcount + 1
else
upcount=upcount+0
endif
j=j+1
next
dncount=n-upcount
k1u=upcount*2-1
k1d=dncount*2-1
k1uu=max(k1u,0.1)
k1dd=max(k1d,0.1)
k2d=-dncount
h1u=max(upcount,1)
h1d=max(k2d,1)
// this (0.1 and 1) because exponential average needs real strictly positive numbers
UpMove=ExponentialAverage[k1uu](h1u)
DnMove=ExponentialAverage[k1dd](h1d)
RS = UpMove/DnMove
ARSI = 100-(100/(1+RS))
// Version 1.
// ARSI formula
// constant period version (looks into the future)
// used also amibroker language translated to Pro Real Time language (since Stock & Commodities article is difficult to understand)
// (u) Period = Param("ARSI Period", 14, 1, 100 );
//(u) Chg = C - Ref( C, -1 );
// (u) UpCount = Sum( Chg >= 0, Period );
// (u) DnCount = Period - UpCount;
//(u) UpMove = EMA( Max( Chg, 0 ), SelectedValue( UpCount) * 2 - 1 );
// DnMove = EMA( Max( -Chg, 0 ), SelectedValue( DnCount ) * 2 - 1 );
// RS = UpMove/DnMove;
//(u) ARSI = 100-(100/(1+RS));
//(u) Plot( ARSI, "ARSI("+Period+")", colorBlue )
// Version 2.
// ARSI formula
// variable period version (backtest-safe)
//(u) = part not implemented yet
// (u) Period = Param("ARSI Period", 14, 1, 100 );
//(u) Chg = C - Ref( C, -1 );
// (v) UpCount = Sum( Chg >= 0, Period );
// (v) DnCount = Period - UpCount;
// (v) UpMove = AMA( Max( Chg, 0 ), 1/UpCount );
// (v) DnMove = AMA( Max( -Chg, 0 ), 1/DnCount );
//(v) RS = UpMove/DnMove;
//(v) ARSI = 100-(100/(1+RS));
//(v) Plot( ARSI, "ARSI_V("+Period+")", colorGreen );
//(v) Plot( RSI( Period ), "RSI", colorRed );
return ARSI coloured (0, 0, 255) as "ARSI", RSInorm as "RSInorm", EMAinvfish coloured (0, 255, 0) as "EMAinvfish", sum coloured (255, 0, 0) as "Sum"
*******************
Results:
- ARSI version 2 has not been developed (since ARSI seems just more a tendency line than an indicator, maybe because of the limite of Pro Real Time trading desk)
- This group of lines cannot be used for trading (different false signals when they open or when crossing ARSI), but also for confirming a state of market (brought to bear or bull), which can be understood also by the lecture of other indicators (supertrend, vortex, random walk...)
- this group of indicator is too hysterical
These results don't change with a different time frame ==> Conclusion: removed form the desk
see images below
guardare le immagini sotto
No comments:
Post a Comment