Announcement

Collapse
No announcement yet.

2005 Dec: Overhauling Market Breadth (BRIN.efs)

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

  • 2005 Dec: Overhauling Market Breadth (BRIN.efs)

    File Name: BRIN.efs

    Description:
    This formula is based on the December 2005 article, Overhauling Market Breadth, by Jacobus R. van den Brink.


    Formula Parameters:
    Index: NASDAQ [NYSE, NASDAQ]


    Notes:
    The study plots the Brin, ILine and VLine indicators. The study has one formula parameter that will set the base Index for the indicator calculations between the NYSE and NASDAQ exchanges. This parameter is set to NASDAQ by default. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.

    Download File:
    BRIN.efs



    EFS Code:
    PHP Code:
    /***************************************
    Provided By : eSignal (c) Copyright 2005
    Description:  Overhauling Market Breadth - by Jacobus R. van den Brink

    Version 1.0  10/11/2005

    Notes:
    December 2005 Issue of Stocks and Commodities Magazine

    * Study requires version 7.9 or higher.


    Formula Parameters:                 Defaults:
    Index                               NASDAQ
        [NYSE, NASDAQ]
    ***************************************/

    function preMain() {
        
    setStudyTitle("BRIN");
        
    setShowTitleParameters(false);
        
    setCursorLabelName("Brin"0);
        
    setCursorLabelName("ILine"1);
        
    setCursorLabelName("VLine"2);
        
    setDefaultBarFgColor(Color.black0);
        
    setDefaultBarFgColor(Color.blue1);
        
    setDefaultBarFgColor(Color.purple2);
        
    setDefaultBarThickness(20);
        
    setDefaultBarThickness(21);
        
    setDefaultBarThickness(22);
        
    setStudyMax(1.3);
        
    setStudyMin(-1.3);
        
    addBand(0PS_SOLID1Color.black"0");
        
    addBand(1PS_SOLID1Color.black"1+");
        
    addBand(-1PS_SOLID1Color.black"1-");
        
        var 
    fp1 = new FunctionParameter("Index"FunctionParameter.STRING);
            
    fp1.setName("Index");
            
    fp1.addOption("NASDAQ");
            
    fp1.addOption("NYSE");
            
    fp1.setDefault("NASDAQ");
        
    }

    var 
    bVersion null;

    var 
    bInit false;
    var 
    Brin null;
    var 
    ILine null;
    var 
    VLine null;

    function 
    main(Index) {    

        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;    

        if (
    bInit == false) {
            
    Brin efsInternal("calcLine""Brin"Index);
            
    ILine efsInternal("calcLine""ILine"Index);
            
    VLine efsInternal("calcLine""VLine"Index);
            
    bInit true;
        }
        
        return new Array(
    getSeries(Brin), getSeries(ILine), getSeries(VLine));
    }


    /***** Support Functions *****/

    var bInitcalcLine false;
    var 
    xDnVol null;
    var 
    xUpVol null;
    var 
    xAdvn null;
    var 
    xDecl null;

    function 
    calcLine(linei) {
        if (
    bInitcalcLine == false) {
            if (
    == "NYSE") {
                
    xDnVol close(sym("$DVOL"));
                
    xUpVol close(sym("$UVOL"));
                
    xAdvn close(sym("$ADV"));
                
    xDecl close(sym("$DECL"));
            } else {
                
    xDnVol close(sym("$DVOLQ"));
                
    xUpVol close(sym("$UVOLQ"));
                
    xAdvn close(sym("$ADVQ"));
                
    xDecl close(sym("$DECLQ"));
            }
            
    bInitcalcLine true;
        }

        if (
    xDnVol == null || xUpVol == null || xAdvn == null || xDecl == null) return;
        
        var 
    DnVol xDnVol.getValue(0);
        var 
    UpVol xUpVol.getValue(0);
        var 
    Advn xAdvn.getValue(0);
        var 
    Decl xDecl.getValue(0);
        var 
    retVal null;
        
        switch(
    line) {
            case 
    "Brin":
                
    retVal = (-(DnVol/UpVol)*(Advn/Decl)) / Math.max(1, (DnVol/UpVol)*(Advn/Decl));
                break;
            case 
    "ILine":
                
    retVal = (1-Math.pow((Advn/Decl), 2)) / Math.max(1Math.pow((Advn/Decl), 2));
                break;
            case 
    "VLine":
                
    retVal = (1-Math.pow((DnVol/UpVol), 2)) / Math.max(1Math.pow((DnVol/UpVol), 2));
                break;
        }

        return 
    retVal;
    }


    function 
    verify() {
        var 
    false;
        if (
    getBuildNumber() < 700) {
            
    drawTextAbsolute(535"This study requires version 7.9 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