Announcement

Collapse
No announcement yet.

2007 Apr: Two-point Problem of the Rate of Change

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

  • 2007 Apr: Two-point Problem of the Rate of Change

    File Name: Adjusted_ROC.efs

    Description:
    This study is based on the April 2007 article, Two-Point Problem of the Rate of Change, by Martti Luoma and Jussi Nikkinen.

    Formula Parameters:
    Periods: 21


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


    Download File:
    Adjusted_ROC.efs



    EFS Code:
    PHP Code:
    /***************************************
    Provided By : eSignal (c) Copyright 2007
    Description:  Two-Point Problem of the Rate of Change 
                  by Martti Luoma and Jussi Nikkinen

    Version 1.0  2/05/2007

    Notes:
    * April 2007 Issue of Stocks and Commodities Magazine
    * Study requires version 8.0 or later.


    Formula Parameters:                     Default:
    Periods                                 21
    *****************************************************************/

    function preMain() {
        
    setStudyTitle("Adjusted ROC ");
        
    setCursorLabelName("AdjROC"0);
        
    setDefaultBarFgColor(Color.red0);
        
    setDefaultBarThickness(20);
        

        var 
    fp1 = new FunctionParameter("Periods"FunctionParameter.NUMBER);
            
    fp1.setName("Periods");
            
    fp1.setLowerLimit(1);
            
    fp1.setDefault(21);
    }

    // Global Variables
    var bVersion  null;    // Version flag
    var bInit     false;   // Initialization flag
    var xAdjROC   null;



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

        
    //Initialization
        
    if (bInit == false) {
            
    xAdjROC efsInternal("calcAdjROC"Periods);
            
    bInit true;
        }

        
        return 
    xAdjROC.getValue(0);
    }


    // AdjROC globals
    var xEMA null;

    function 
    calcAdjROC(nP) {
        if (
    bInit == false) {
            
    xEMA ema(nProc(1));
            
    bInit true;
        }
        
        var 
    nEMA xEMA.getValue(0);
        if (
    nEMA == null) return;
        
        return (
    nEMA nP);
    }


    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