Announcement

Collapse
No announcement yet.

DirectionCongestion.efs

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

  • DirectionCongestion.efs

    File Name: DirectionCongestion.efs

    Description:
    This formula is based on an RSI study and identifies general direction and areas of congestion.

    Formula Parameters:
    Price Source: Default is “Close”
    RSILength: Default is 21.
    LEN: Default is 9. This is a constant used by the formula calculation.
    Upper_Dot_Color: Default is Cyan.
    Lower_Dot_Color: Default is Maroon.

    Notes:
    Bars that have dots both above and below the bars represent the areas of congestion. If the dots are only above the bars, the general direction is negative and positive when the dots are only below the bars.

    Download File:
    DirectionCongestion.efs




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


    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Direction/Congestion ");
        
    setShowCursorLabel(false);
        
    setComputeOnClose(true);
        
    setDefaultBarStyle(PS_SOLID0);
        
    setDefaultBarStyle(PS_SOLID1);
        
    setPlotType(PLOTTYPE_DOT0);
        
    setPlotType(PLOTTYPE_DOT1);
        
    setDefaultBarThickness(10);
        
    setDefaultBarThickness(11);
        
    setDefaultBarFgColor(Color.maroon0);
        
    setDefaultBarFgColor(Color.maroon1);

        var 
    fp1 = new FunctionParameter("Price_Source"FunctionParameter.STRING);
        
    fp1.setName("Price Source");
        
    fp1.addOption("Open");
        
    fp1.addOption("High");
        
    fp1.addOption("Low");
        
    fp1.addOption("Close");
        
    fp1.addOption("HL/2");
        
    fp1.addOption("HLC/3");
        
    fp1.addOption("OHLC/4");
        
    fp1.setDefault("Close");

        var 
    fp2 = new FunctionParameter("RSILength"FunctionParameter.NUMBER);
        
    fp2.setName("RSILength");
        
    fp2.setLowerLimit(1);        
        
    fp2.setUpperLimit(1000);
        
    fp2.setDefault(21);
        
        var 
    fp3 = new FunctionParameter("LEN"FunctionParameter.NUMBER);
        
    fp3.setName("LEN");
        
    fp3.setLowerLimit(1);        
        
    fp3.setUpperLimit(1000);
        
    fp3.setDefault(9);

        var 
    fp4 = new FunctionParameter("Upper_Dot_Color"FunctionParameter.COLOR);
        
    fp4.setName("Upper_Dot_Color");
        
    fp4.setDefault(Color.cyan);

        var 
    fp5 = new FunctionParameter("Lower_Dot_Color"FunctionParameter.COLOR);
        
    fp5.setName("Lower_Dot_Color");
        
    fp5.setDefault(Color.maroon);
    }

    var 
    study null;
    var 
    Center 0;
    var 
    Upper 0;
    var 
    Lower 0;
    var 
    Avernge 0;
    var 
    BarCntr 0;
    var 
    Value3 null;    // Sell line
    var Value4 null;    // Buy Line

    function main(Price_SourceRSILengthLENUpper_Dot_ColorLower_Dot_Color) {
        
    RSILength Math.abs(Math.round(RSILength));
        
    LEN Math.abs(Math.round(LEN));
        if (
    study == nullstudy = new RSIStudy(RSILengthPrice_Source);
        
        var 
    vRSI study.getValue(RSIStudy.RSI);
        if (
    vRSI == null) return;

        var 
    Constnt 4;


        if (
    getBarState() == BARSTATE_NEWBAR) {
            
    BarCntr += 1;
        }

        
    Value3 = (Center Upper)/2;    // Sell line
        
    Value4 = (Center Lower)/2;    // Buy Line
        
    Center = (Center * (LEN-1) + close()) / LEN;
        
    Avernge = (Avernge * (LEN-1) + high() - low()) / LEN;
        
    Upper Center Avernge Constnt;
        
    Lower Center Avernge Constnt;

        
    setBarFgColor(Upper_Dot_Color0);
        
    setBarFgColor(Lower_Dot_Color1);

        if (
    BarCntr 20) {
            if (
    vRSI 52Value3 null;
            if (
    vRSI 48Value4 null;
            return new Array(
    Value3Value4);
        } else {
            return;
        }

    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