Announcement

Collapse
No announcement yet.

2006 Oct: Relative Spread Strength As A Long-Term Cyclic Tool by Ian Copsey

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

  • 2006 Oct: Relative Spread Strength As A Long-Term Cyclic Tool by Ian Copsey

    File Name: RSS.efs, Rapid_RSS.efs

    Description:
    These studies are based on the October 2006 article, Relative Spread Strength As A Long-Term Cyclic Tool, by Ian Copsey.

    Formula Parameters:
    RSS.efs
    RS Length: 5
    High Band: 80
    Low Band: 20
    Slow MA Length: 40
    Fast MA Length: 10

    Rapid_RSS.efs
    Length: 14
    OverBought: 70
    OverSold: 30

    Notes:
    These formulas require eSignal version 8.0.0 or later. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.

    Download File:
    RSS.efs
    Rapid_RSS.efs





    EFS Code:
    PHP Code:
    /***************************************
    Provided By : eSignal (c) Copyright 2006
    Description:  Relative Spread Strength 
                  As A Long-Term Cyclic Tool
                  by Ian Copsey

    Version 1.0  08/11/2006

    Notes:
    * Oct 2006 Issue of Stocks and Commodities Magazine
    * Study requires version 8.0 or higher.


    Formula Parameters:                 Defaults:
    RS Length                           5
    High Band                           80
    Low Band                            20
    Slow MA Length                      40
    Fast MA Length                      10
    ***************************************/


    function preMain() {
        
    setStudyTitle("Relative Spread Strength ");
        
    setCursorLabelName("RSS"0);
        
    setDefaultBarThickness(20); 
        
    setDefaultBarFgColor(Color.red0);

        var 
    fp1 = new FunctionParameter("nRSLength"FunctionParameter.NUMBER);
            
    fp1.setName("RS Length");
            
    fp1.setLowerLimit(1);
            
    fp1.setDefault(5);
        var 
    fp2 = new FunctionParameter("nHband"FunctionParameter.NUMBER);
            
    fp2.setName("High Band");
            
    fp2.setDefault(80);
        var 
    fp3 = new FunctionParameter("nLband"FunctionParameter.NUMBER);
            
    fp3.setName("Low Band");
            
    fp3.setDefault(20);
        var 
    fp4 = new FunctionParameter("nLenMA2"FunctionParameter.NUMBER);
            
    fp4.setName("Slow MA Length");
            
    fp4.setLowerLimit(1);
            
    fp4.setDefault(40);
        var 
    fp5 = new FunctionParameter("nLenMA1"FunctionParameter.NUMBER);
            
    fp5.setName("Fast MA Length");
            
    fp5.setLowerLimit(1);
            
    fp5.setDefault(10);
    }


    var 
    bVersion null;
    var 
    bInit false;

    var 
    xSpread null;
    var 
    xRSI null;
    var 
    xRSS null;

    function 
    main(nRSLengthnHbandnLbandnLenMA1nLenMA2) {    
        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;    

        if (
    bInit == false) {
            
    addBand(nHbandPS_SOLID2Color.blue"High");
            
    addBand(nLbandPS_SOLID2Color.blue"Low");
            
    xSpread efsInternal("calcSpread"nLenMA1nLenMA2);
            
    xRSI rsi(nRSLengthxSpread);
            
    xRSS sma(5xRSI);
            
    bInit true;
        }
        
        return 
    xRSS.getValue(0);
    }


    var 
    xMA1 null;
    var 
    xMA2 null;

    function 
    calcSpread(nLen1nLen2) {
        if (
    xMA1 == nullxMA1 ema(nLen1);
        if (
    xMA2 == nullxMA2 ema(nLen2);
        
        var 
    nE1 xMA1.getValue(0);
        var 
    nE2 xMA2.getValue(0);
        if (
    nE1 == null || nE2 == null) return;
        
        return (
    nE1 nE2);
    }


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

    PHP Code:
    /***************************************
    Provided By : eSignal (c) Copyright 2006
    Description:  Relative Spread Strength 
                  As A Long-Term Cyclic Tool
                  by Ian Copsey

    Version 1.0  08/11/2006

    Notes:
    * Oct 2006 Issue of Stocks and Commodities Magazine
    * Study requires version 8.0 or higher.


    Formula Parameters:                 Defaults:
    Length                              14
    OverBought                          70
    OverSold                            30
    ***************************************/


    function preMain() {
        
    setStudyTitle("Rapid RSI ");
        
    setCursorLabelName("CRS"0);
        
    setDefaultBarThickness(20); 
        
    setDefaultBarFgColor(Color.navy0);

        var 
    fp1 = new FunctionParameter("nLength"FunctionParameter.NUMBER);
            
    fp1.setName("Length");
            
    fp1.setLowerLimit(1);
            
    fp1.setDefault(14);
        var 
    fp2 = new FunctionParameter("nOb"FunctionParameter.NUMBER);
            
    fp2.setName("OverBought");
            
    fp2.setDefault(70);
        var 
    fp3 = new FunctionParameter("nOs"FunctionParameter.NUMBER);
            
    fp3.setName("OverSold");
            
    fp3.setDefault(30);
    }


    var 
    bVersion null;
    var 
    bInit false;

    var 
    xRapidRSI null;

    function 
    main(nLengthnObnOs) {    
        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;    

        if (
    bInit == false) {
            
    addBand(nObPS_SOLID2Color.blue"OB");
            
    addBand(nOsPS_SOLID2Color.blue"OS");
            
    xRapidRSI efsInternal("calcRSS"nLength);
            
    bInit true;
        }
        
        return 
    xRapidRSI.getValue(0);
    }


    function 
    calcRSS(nLen) {
        var 
    nCntr 0;
        var 
    nUpSum 0;
        var 
    nDnSum 0;
        var 
    nRS 0;
        var 
    nCRS null;
        
        for (
    nCntr 0nCntr nLennCntr++) {
            if (
    close(-nCntr) > close(-(nCntr+1)) ) {
                
    nUpSum += close(-nCntr) - close(-(nCntr+1));
            }
            if (
    close(-nCntr) < close(-(nCntr+1)) ) {
                
    nDnSum += close(-(nCntr+1)) - close(-nCntr);
            }
        }

        if (
    nDnSum != 0) {
            
    nRS nUpSum nDnSum;
        } else {
            
    nRS 100;
        }

        if (
    getCurrentBarCount() > nLen && nUpSum != nDnSum) {
            
    nCRS 100 100 / (nRS);
        } else {
            
    nCRS 0;
        }

        return 
    nCRS;
    }


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

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation
Working...
X