Announcement

Collapse
No announcement yet.

2011 May: In The Volume Zone

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

  • 2011 May: In The Volume Zone

    File Name: VolumeZoneOsc.efs

    Description:
    The Volume Zone Oscillator

    Formula Parameters:
    Period: 14

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

    Download File:
    VolumeZoneOsc.efs



    EFS Code:
    PHP Code:
    /*********************************
    Provided By:  
        Interactive Data Corporation (Copyright © 2010) 
        All rights reserved. This sample eSignal Formula Script (EFS)
        is for educational purposes only. Interactive Data Corporation
        reserves the right to modify and overwrite this EFS file with 
        each new release. 
        
    Description:        
        The Volume Zone Oscillator 
     
    Version:            1.0  14/03/2011

    Formula Parameters:                     Default:
        Period                                14
        
    Notes:
        The related article is copyrighted material. If you are not
        a subscriber of Stocks & Commodities, please visit 
    [url]www.traders.com.[/url]

    **********************************/

    var fpArray = new Array();
    var 
    bVersion null;
    function 
    preMain()
    {
        
    setStudyMin(-100);
        
    setStudyMax(100);
        
    setStudyTitle("Volume Zone Oscillator");
        
    setCursorLabelName("Volume Zone Osc"0);
        
        var 
    x=0;
        
    fpArray[x] = new FunctionParameter("gPeriod"FunctionParameter.NUMBER);
        
    with(fpArray[x++])
        {
        
    setName("Period");
        
    setLowerLimit(1);
            
    setDefault(14);
        }

        
    fpArray[x] = new FunctionParameter("gLevels"FunctionParameter.BOOLEAN);
        
    with(fpArray[x++])
        {
        
    setName("Show Levels");
            
    setDefault(true);
        }
    }

    var 
    bInit false;
    var 
    xVol null;
    var 
    xR null;
    var 
    xVP null;
    var 
    xTV null;
    function 
    main(gPeriodgLevels)
    {

        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;     
            
        if (!
    bInit)
        {
            
    xVol volume();
            
    xR efsInternal("calcSignedVol"xVolclose());  
            
    xVP ema(gPeriodxR);
            
    xTV ema(gPeriodxVol);
            if ( 
    gLevels )
            {
                    
    addBand(60PS_DOT2Color.green"lev60");
                    
    addBand(40PS_DASH2Color.darkgreen"lev40");
                    
    addBand(15PS_SOLID1Color.grey"lev15");
                    
    addBand(0PS_SOLID2Color.grey"lev0");
                    
    addBand(-5PS_SOLID1Color.grey"lev5n");
                    
    addBand(-40PS_DASH2Color.maroon"lev40n");
                    
    addBand(-60PS_DOT2Color.red"lev60n");
            }
            
    bInit true;
        }
        var 
    vVP xVP.getValue(0);
        var 
    vTV xTV.getValue(0);
        if ( 
    vVP == null ) return null;
        var 
    vVZO 100;  
        if ( 
    vTV != vVZO 100 vVP vTV;      
        return 
    vVZO;    
        
    }

    function 
    calcSignedVol(xVolxCls)
    {
            var 
    vVol xVol.getValue(0);
            var 
    vCls1 xCls.getValue(-1);
            var 
    vCls0 xCls.getValue(0);
            if ( 
    vCls1 == null ) return null;
            
    vVol = (vCls1 vCls0)? vVol : -vVol;
            return 
    vVol;
    }

    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;

    Last edited by eSignal; 04-15-2011, 03:10 AM.
Working...
X