Announcement

Collapse
No announcement yet.

2006 Mar Bonus Issue: Bandwidth Volatility Extremes by Barbara Star, Ph.D.

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

  • 2006 Mar Bonus Issue: Bandwidth Volatility Extremes by Barbara Star, Ph.D.

    File Names: extremeBandwidth.efs, extremeBWdirectional.efs

    Description:
    These studies are based on the March 2006 Bonus Issue article, Bandwidth Volatility Extremes, by Barbara Star, Ph.D.

    Formula Parameters:
    extremeBandwidth.efs
    XBB Length: 8
    BB Length: 20
    Standard Deviations: 2

    extremeBWdirectional.efs
    XBB Length: 8
    BB Length: 20
    Standard Deviations: 2
    Image Size: Large [Large, Small]

    Notes:
    The original Bollinger Bandwidth study that is compared to the extreme Bandwidth study can be found in \eSignal\Formulas\Bollinger\Bandwidth.efs. These formula studies require eSignal version 7.9 or later. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.

    Download Files:
    extremeBandwidth.efs
    extremeBWdirectional.efs






    EFS Code:
    PHP Code:
    /************
    Copyright © eSignal, a division of Interactive Data Corporation. 2005. All rights reserved. 
    This sample eSignal Formula Script (EFS) may be modified and saved under a new 
    filename; however, eSignal is no longer responsible for the functionality once modified.
    eSignal reserves the right to modify and overwrite this EFS file with each new release.
    ************/


    function preMain() {
        
    setStudyTitle("Extreme BandWidth");
        
    setCursorLabelName("XBW"0);
        
    setDefaultBarFgColor(Color.blue);
        
    setDefaultBarThickness(2);
        
    addBand(35PS_DOT2Color.black35);
        
    addBand(-30PS_DOT2Color.black, -30);
        
        var 
    fp0 = new FunctionParameter("nXBBLen"FunctionParameter.NUMBER);
            
    fp0.setName("XBB Length");
            
    fp0.setLowerLimit(1);
            
    fp0.setDefault(8);

        var 
    fp1 = new FunctionParameter("nLength"FunctionParameter.NUMBER);
            
    fp1.setName("BB Length");
            
    fp1.setLowerLimit(1);
            
    fp1.setDefault(20);

        var 
    fp2 = new FunctionParameter("nStdv"FunctionParameter.NUMBER);
            
    fp2.setName("Standard Deviations");
            
    fp2.setLowerLimit(0);
            
    fp2.setDefault(2);
    }


    var 
    bInit false;
    var 
    xRoc null;
    var 
    xbbw null;
    var 
    bbUpper null;
    var 
    bbLower null;
    var 
    bbMiddle null;

    function 
    main(nXBBLennLengthnStdv) {
        if (
    bInit == false) {
            
    xbbw efsInternal("bbw"nLengthnStdv);
            
    xRoc roc(nXBBLenxbbw);
            
    bInit true;
        }
        
        return 
    xRoc.getValue(0);
    }

    function 
    bbw(ns) {
        
    bbUpper upperBB(ns);
        
    bbLower lowerBB(ns);
        
    bbMiddle middleBB(ns);
        return (
    bbUpper.getValue(0) - bbLower.getValue(0)) / bbMiddle.getValue(0) * 100;
    }



    /************
    Copyright © eSignal, a division of Interactive Data Corporation. 2005. All rights reserved. 
    This sample eSignal Formula Script (EFS) may be modified and saved under a new 
    filename; however, eSignal is no longer responsible for the functionality once modified.
    eSignal reserves the right to modify and overwrite this EFS file with each new release.
    ************/


    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Extreme BandWidth Directional");
        
    setCursorLabelName("XBW"0);
        
    setCursorLabelName("SMA"1);
        
    setCursorLabelName("Upper BB"2);
        
    setCursorLabelName("Lower BB"3);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.red1);
        
    setDefaultBarFgColor(Color.red2);
        
    setDefaultBarFgColor(Color.red3);
        
    setDefaultBarThickness(20);
        
    setDefaultBarThickness(11);
        
    setDefaultBarThickness(12);
        
    setDefaultBarThickness(13);
        
        var 
    fp0 = new FunctionParameter("nXBBLen"FunctionParameter.NUMBER);
            
    fp0.setName("XBB Length");
            
    fp0.setLowerLimit(1);
            
    fp0.setDefault(8);

        var 
    fp1 = new FunctionParameter("nLength"FunctionParameter.NUMBER);
            
    fp1.setName("BB Length");
            
    fp1.setLowerLimit(1);
            
    fp1.setDefault(20);

        var 
    fp2 = new FunctionParameter("nStdv"FunctionParameter.NUMBER);
            
    fp2.setName("Standard Deviations");
            
    fp2.setLowerLimit(0);
            
    fp2.setDefault(2);

        var 
    fp3 = new FunctionParameter("sSize"FunctionParameter.STRING);
            
    fp3.setName("Image Size");
            
    fp3.addOption("Large");
            
    fp3.addOption("Small");
            
    fp3.setDefault("Large");
    }


    var 
    bInit false;
    var 
    xRoc null;
    var 
    xbbw null;
    var 
    xMiddleBB null;
    var 
    xUpperBB null;
    var 
    xLowerBB null;
    var 
    xMa null;
    var 
    bbUpper null;
    var 
    bbLower null;
    var 
    bbMiddle null;
    var 
    nCntr 0;
    var 
    nAboveBar1 null;
    var 
    nBelowBar1 null;
    var 
    nSize 14;

    function 
    main(nXBBLennLengthnStdvsSize) {
        if (
    bInit == false) {
            
    xbbw efsInternal("bbw"nLengthnStdv);
            
    xRoc roc(nXBBLenxbbw);
            
    xMa sma(18);
            
    xMiddleBB middleBB(nLengthnStdv);
            
    xUpperBB  upperBB(nLengthnStdv);
            
    xLowerBB  lowerBB(nLengthnStdv);
            
    bInit true;
        }
        
        if (
    getBarState() == BARSTATE_NEWBARnCntr++;
        
        var 
    nRoc xRoc.getValue(0);
        var 
    nRoc_1 xRoc.getValue(-1);
        var 
    nMa xMa.getValue(0);
        if (
    nRoc == null || nRoc_1 == null || nMa == null) return;
        
        if (
    nAboveBar1 == null && xUpperBB.getValue(0) != null) {
            
    nAboveBar1 nBelowBar1 = (xUpperBB.getValue(0) - xLowerBB.getValue(0)) * .07;
        }
        
        
    // extreme Narrow Upper
        
    if (nRoc < -30 && nRoc_1 > -30 && close(0) > nMa) {
            if (
    sSize == "Small") {
                
    drawShapeRelative(0high(0)+nAboveBar1Shape.DIAMONDnullColor.redShape.BOTTOM"nu"+nCntr);
            } else {
                
    drawTextRelative(0high(0)+nAboveBar1"u"Color.rednull
                    
    Text.CENTER|Text.VCENTER|Text.BOLD|Text.ONTOP"Wingdings"nSize"nu"+nCntr);
            }
        } else {
            
    removeShape("nu"+nCntr);
        }
        
        
    // extreme Narrow Lower
        
    if (nRoc < -30 && nRoc_1 > -30 && close(0) < nMa) {
            if (
    sSize == "Small") {
                
    drawShapeRelative(0low(0)-nBelowBar1Shape.DIAMONDnullColor.redShape.TOP"nl"+nCntr);
            } else {
                
    drawTextRelative(0low(0)-nBelowBar1"u"Color.rednull
                    
    Text.CENTER|Text.VCENTER|Text.BOLD|Text.ONTOP"Wingdings"nSize"nl"+nCntr);
            }
        } else {
            
    removeShape("nl"+nCntr);
        }

        
    // Wide Upper
        
    if (nRoc 35 && nRoc_1 35 && close(0) > nMa) {
            if (
    sSize == "Small") {
                
    drawShapeRelative(0high(0)+nAboveBar1Shape.DIAMONDnullColor.blueShape.BOTTOM"wu"+nCntr);
            } else {
                
    drawTextRelative(0high(0)+nAboveBar1"u"Color.bluenull
                    
    Text.CENTER|Text.VCENTER|Text.BOLD|Text.ONTOP"Wingdings"nSize"wu"+nCntr);
            }
        } else {
            
    removeShape("wu"+nCntr);
        }
        
        
    // Wide Lower
        
    if (nRoc 35 && nRoc_1 35 && close(0) < nMa) {
            if (
    sSize == "Small") {
                
    drawShapeRelative(0low(0)-nBelowBar1Shape.DIAMONDnullColor.blueShape.TOP"wl"+nCntr);
            } else {
                
    drawTextRelative(0low(0)-nBelowBar1"u"Color.bluenull
                    
    Text.CENTER|Text.VCENTER|Text.BOLD|Text.ONTOP"Wingdings"nSize"wl"+nCntr);
            }
        } else {
            
    removeShape("wl"+nCntr);
        }
        
        return new Array(
    nRoc.toFixed(4), xMiddleBB.getValue(0), xUpperBB.getValue(0), xLowerBB.getValue(0));
    }

    function 
    bbw(ns) {
        
    bbUpper upperBB(ns);
        
    bbLower lowerBB(ns);
        
    bbMiddle middleBB(ns);
        return (
    bbUpper.getValue(0) - bbLower.getValue(0)) / bbMiddle.getValue(0) * 100;

    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