ARSI System

#1
Hi,
This is the code of TASC's Latest issue's Sylvain Vervoort's article in "ARSI, The Asymmetrical RSI


// Version 1.
// ARSI formula
// constant period version (looks into the future)
Period = Param("ARSI Period", 14, 1, 100 );
Chg = C - Ref( C, -1 );
UpCount = Sum( Chg >= 0, Period );
DnCount = Period - UpCount;
UpMove = EMA( Max( Chg, 0 ), SelectedValue( UpCount) * 2 - 1 );
DnMove = EMA( Max( -Chg, 0 ), SelectedValue( DnCount ) * 2 - 1 );
RS = UpMove/DnMove;
ARSI = 100-(100/(1+RS));
Plot( ARSI, "ARSI("+Period+")", colorBlue );
// Version 2.
// ARSI formula
// variable period version (backtest-safe)
Period = Param("ARSI Period", 14, 1, 100 );
Chg = C - Ref( C, -1 );
UpCount = Sum( Chg >= 0, Period );
DnCount = Period - UpCount;
UpMove = AMA( Max( Chg, 0 ), 1/UpCount );
DnMove = AMA( Max( -Chg, 0 ), 1/DnCount );
RS = UpMove/DnMove;
ARSI = 100-(100/(1+RS));
Plot( ARSI, "ARSI_V("+Period+")", colorGreen );
Plot( RSI( Period ), "RSI", colorRed );

I would request the members to help me out, by coding the following buy sell conditions

Enter a long position when:
1) Today's low is less than the last pivot low of 20 bar strength, and
2) Today's ARSI value is greater than its value on the date of the price pivot low of 20 bar strength, and
3) The ARSI has been less than 30 in the last two bars, and
4) This is the first such signal in the last two bars,
5) Enter on a stop next bar at high of the setup bar.

The exit rules for long positions:
1) If the ARSI is greater than 70, or
2) If a closing basis loss of 3 or more average true ranges (ATRs) occurs
3) Exit at market at next day's opening price.

Thanks & regards
 
Thread starter Similar threads Forum Replies Date
A Forex 0
K AmiBroker 0
B AmiBroker 4
G F-Chart 2
A Software 10

Similar threads