Announcement

Collapse
No announcement yet.

KeltnerArEmaAdj.efs

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

  • KeltnerArEmaAdj.efs

    File Name: KeltnerArEmaAdj.efs

    Description:
    Keltner study with a 20 period exponential moving average of the basis line and bands based on 2.5 * Average Range.

    Formula Parameters:
    nInputLength: Default is 20
    nRangeFactor: Default is 2.5

    Notes:


    Download File:
    KeltnerArEmaAdj.efs




    EFS Code:
    PHP Code:
    /*********************************
    Provided By : eSignal. (c) Copyright 2003
    *********************************/

    function preMain() {
        
    setPriceStudy(true);
        
        
    /* Set the title that will appear in the study pane */
        
    setStudyTitle("Keltner");

        
    /* Set the label that will appear in the cursor window */
        
    setCursorLabelName("K-Upper"0);
        
    setCursorLabelName("K-Basis"1);
        
    setCursorLabelName("K-Lower"2);

        
    setDefaultBarFgColor(Color.blue0); // upper
        
    setDefaultBarFgColor(Color.red1); // basis
        
    setDefaultBarFgColor(Color.blue2); // lower
    }


    function 
    main(nInputLengthnRangeFactor) {
        if(
    nInputLength == null)
            
    nInputLength 20;
        if(
    nInputLength <= 0)
            
    nInputLength 20;

        if(
    nRangeFactor == null)
            
    nRangeFactor 2.5;
        if(
    nRangeFactor <= 0)
            
    nRangeFactor 2.5;

        var 
    dHigh high(0, -nInputLength);
        var 
    dLow low(0, -nInputLength);
        var 
    dKeltnerBasiscall("/Library/KeltnerEMA.efs"nInputLength);

        if(
    dHigh == null || dLow == null || dKeltnerBasis == null)
            return;

        var 
    dHminL 0;
        var 
    i;

        for(
    0nInputLengthi++) {
            
    dHminL += dHigh[i] - dLow[i];
        }

        
    dHminL /= nInputLength;

        return new Array(
    dKeltnerBasis + (nRangeFactor dHminL), dKeltnerBasisdKeltnerBasis - (nRangeFactor dHminL));

    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