Announcement

Collapse
No announcement yet.

RSI of ROC

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RSI of ROC

    File Name: RSI_ROC.efs

    Description:
    RSI based on ROC

    Formula Parameters:
    Length of RSI : 20
    Length of ROC : 20
    Source of ROC : Close
    Upper : 70
    Lower : 30


    Notes:
    This is the new-age indicator which is version of RSI calculated upon
    the Rate-of-change indicator.
    The name "Relative Strength Index" is slightly misleading as the RSI
    does not compare the relative strength of two securities, but rather
    the internal strength of a single security. A more appropriate name
    might be "Internal Strength Index." Relative strength charts that compare
    two market indices, which are often referred to as Comparative Relative Strength.
    And in its turn, the Rate-of-Change ("ROC") indicator displays the difference
    between the current price and the price x-time periods ago. The difference can
    be displayed in either points or as a percentage. The Momentum indicator displays
    the same information, but expresses it as a ratio.


    Download File:
    RSI_ROC.efs



    EFS Code:
    PHP Code:
    /*********************************
    Provided By:  
        eSignal (Copyright c eSignal), a division of Interactive Data 
        Corporation. 2009. 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:        
        RSI based on ROC
         
    Version:            2.0  04/28/2009
        
    Formula Parameters:                     Default:
        Length of RSI                       20
        Length of ROC                       20
        Source of ROC                       Close
        Upper                               70
        Lower                               30
        
    Notes:
        This is the new-age indicator which is version of RSI calculated upon 
        the Rate-of-change indicator.
        The name "Relative Strength Index" is slightly misleading as the RSI 
        does not compare the relative strength of two securities, but rather 
        the internal strength of a single security. A more appropriate name 
        might be "Internal Strength Index." Relative strength charts that compare 
        two market indices, which are often referred to as Comparative Relative Strength.
        And in its turn, the Rate-of-Change ("ROC") indicator displays the difference 
        between the current price and the price x-time periods ago. The difference can 
        be displayed in either points or as a percentage. The Momentum indicator displays 
        the same information, but expresses it as a ratio.

    **********************************/
    var fpArray = new Array();
    var 
    bInit false;

    function 
    preMain() {
        
    setStudyTitle("RSI(ROC)"); 
        
    setCursorLabelName("RSI(ROC)",0);
        
    setShowTitleParameters(false);        
        
    setDefaultBarFgColor(Color.blue,0);
        
    setStudyMax(101);
        
    setStudyMin(-1);
        var 
    0;
        
    fpArray[x] = new FunctionParameter("RSILength"FunctionParameter.NUMBER);
        
    with(fpArray[x++]) {
            
    setName("Length of RSI");
            
    setLowerLimit(1);
            
    setDefault(20);
        }
        
    fpArray[x] = new FunctionParameter("ROCLength"FunctionParameter.NUMBER);
        
    with(fpArray[x++]) {
            
    setName("Length of ROC");
            
    setLowerLimit(1);
            
    setDefault(20);
        }
        
    fpArray[x] = new FunctionParameter("Upper"FunctionParameter.NUMBER);
        
    with(fpArray[x++]) {
            
    setLowerLimit(0);
            
    setDefault(70);
        }
        
    fpArray[x] = new FunctionParameter("Lower"FunctionParameter.NUMBER);
        
    with(fpArray[x++]) {
            
    setLowerLimit(0);
            
    setDefault(30);
        }
        
    fpArray[x] = new FunctionParameter("Source"FunctionParameter.STRING);
        
    with(fpArray[x++]){
            
    setName("Source of ROC");
            
    addOption("open"); 
            
    addOption("high");
            
    addOption("low");
            
    addOption("close");
            
    addOption("hl2");
            
    addOption("hlc3");
            
    addOption("ohlc4"); 
            
    setDefault("close"); 
        }    
    }

    var 
    xRSI null;

    function 
    main(RSILengthROCLengthSourceUpperLower) {
    var 
    nBarState getBarState();
    var 
    nRSI 0;
        if (
    nBarState == BARSTATE_ALLBARS) {
            if(
    RSILength == nullRSILength 20;
            if(
    ROCLength == nullROCLength 20;
            if(
    Source == nullSource "close";
            if(
    Upper == nullUpper 70;
            if(
    Lower == nullLower 30;
        }
        if (
    bInit == false) {
            
    addBand(UpperPS_SOLID2Color.grey"Upper");
            
    addBand(LowerPS_SOLID2Color.grey"Lower");        
            
    xRSI rsi(RSILengthroc(ROCLength, eval(Source)()));
            
    bInit true;
        }
        
    nRSI xRSI.getValue(0);
        if (
    nRSI == null) return;
        return 
    nRSI;

    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11
Working...
X