2008 Oct: ARSI, The Asymmetrical RSI

ICE Data Services -

ARSI.efs  

EFSLibrary - Discussion Board  

File Name: ARSI.efs

Description:
The following study is based on the October 2008 article, ARSI, The Asymmetrical RSI, by Sylvain Vervoort.

Formula Parameters:

  • Period: 14
  • Upper Band: 70
  • Lower Band: 30
  • ARSI Color: Blue
  • RSI Color: Red
  • Show Parameters: False

Notes:
The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.

Download File:
ARSI.efs



EFS Code:

/*********************************
Provided By:  
    eSignal (Copyright c eSignal), a division of Interactive Data 
    Corporation. 2008. All rights reserved. This sample eSignal 
    Formula Script (EFS) is for educational purposes only and may be 
    modified and saved under a new file name.  eSignal is not responsible
    for the functionality once modified.  eSignal reserves the right 
    to modify and overwrite this EFS file with each new release.
   

Description:        
    ARSI, The Asymmetrical RSI by Sylvain Vervoort

Version:            1.0  08/07/2008

Notes:
    October 2008 issue of Stocks & Commodities Magazine

Formula Parameters:                     Default:
    Period                               14
    Upper Band                           70
    Lower Band                           30
    ARSI Color                           Blue
    RSI Color                            Red
    Show Parameters                      False
**********************************/

var fpArray = new Array();

function preMain() {
    setPriceStudy(false);
    setStudyTitle("ARSI ");
    setCursorLabelName("ARSI", 0);
    setCursorLabelName("RSI", 1);            

    setDefaultBarFgColor(Color.blue, 0);
    setDefaultBarFgColor(Color.red, 1);    

    setPlotType(PLOTTYPE_LINE, 0); 
    setPlotType(PLOTTYPE_LINE, 1);     

    setDefaultBarThickness(1, 0);
    setDefaultBarThickness(1, 1);    

    askForInput();

    var x=0;
    fpArray[x] = new FunctionParameter("Period", FunctionParameter.NUMBER);
    with(fpArray[x++]){
        setName("Period");
        setLowerLimit(1);        
        setUpperLimit(100);        
        setDefault(14);
    }

    fpArray[x] = new FunctionParameter("Color1", FunctionParameter.COLOR);
    with(fpArray[x++]){
        setName("ARSI Color");
        setDefault(Color.blue);
    }    

    fpArray[x] = new FunctionParameter("Color2", FunctionParameter.COLOR);
    with(fpArray[x++]){
        setName("RSI Color");
        setDefault(Color.red);
    }    

    fpArray[x] = new FunctionParameter("Upper", FunctionParameter.NUMBER);
    with(fpArray[x++]){
        setName("Upper Band");
        setLowerLimit(0);        
        setDefault(70);
    }

    fpArray[x] = new FunctionParameter("Lower", FunctionParameter.NUMBER);
    with(fpArray[x++]){
        setName("Lower Band");    
        setLowerLimit(0);        
        setDefault(30);
    }

    fpArray[x] = new FunctionParameter("ShowParam", FunctionParameter.BOOLEAN);
    with(fpArray[x++]){
       setName("Show Parameters");
       setDefault(false);
    }    

}

var xSum1 = null
var xSum2 = null;
var xSum3 = null;
var xSum4 = null;
var xRSI  = null;
var bInit = false;
var bVersion = null;


function main(Period, Upper, Lower, Color1, Color2, ShowParam){

    if (bVersion == null) bVersion = verify();
    if (bVersion == false) return;   
    if(getCurrentBarCount()<period) return;="" if(binit="=false){" xsum1="efsInternal("Sum",Period);" xsum2="getSeries(xSum1,1);" xsum3="getSeries(xSum1,2);" xsum4="getSeries(xSum1,3);" xrsi="rsi(Period);" addband(upper,ps_solid,1,color.grey,="addband(upper,ps_solid,1,color.grey," upperband="upperband" );="" addband(lower,ps_solid,1,color.grey,="addband(lower,ps_solid,1,color.grey," lowerband="lowerband" setshowtitleparameters(="" showparam="" binit="true;" }="" var="" xupmoveavg="ema((xSum1.getValue(0)*2)-1,xSum3);" xdnmoveavg="ema((xSum2.getValue(0)*2)-1,xSum4);" if(xupmoveavg="=null||xDnMoveAvg==null)" rs="xUpMoveAvg.getValue(0)/xDnMoveAvg.getValue(0);" nrsi="xRSI.getValue(0);" if(nrsi="=null)" return="" new="" array="" (100-(100="" (1+rs)),nrsi)="" xmom="null;" xinit="false;" function="" sum(period){="" if(xinit="=false){" nsum="0;" for(var="" i="0;"><="" period;="" i++){="" if(xmom.getvalue(-i)="">= 0) {
            nSum += 1;
        }
    } 
    
    var UpCount = nSum;
    var DnCount = Period-UpCount;
    var UpMove = xMom.getValue(0)>=0?xMom.getValue(0):0;
    var DnMove = xMom.getValue(0)<0?Math.abs(xMom.getValue(0)):0;

    return new Array(UpCount,DnCount,UpMove,DnMove);
}


function verify() {
    var b = false;
    if (getBuildNumber() < 779) {
        drawTextAbsolute(5, 35, "This study requires version 8.0 or later.", 
            Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
            null, 13, "error");
        drawTextAbsolute(5, 20, "Click HERE to upgrade.@URL=http://www.esignal.com/download/default.asp", 
            Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
            null, 13, "upgrade");
        return b;
    } else {
        b = true;
    }
    return b;
}