Announcement

Collapse
No announcement yet.

2011 Jun: The Price Zone Oscillator

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

  • 2011 Jun: The Price Zone Oscillator

    File Name: PriceZoneOsc.efs, PriceZoneOscWL.efs

    Description:
    The Price Zone Oscillator and The Price Zone Oscillator for Watch List

    Formula Parameters:
    PriceZoneOsc.efs
    Period : 14
    PriceZoneOscWL.efs
    Period : 14
    View Type : Text
    Coloring Type : Font
    Super Overbought Color : Color.green
    Overbought Color : Color.lime
    Positive Movement Color : Color.RGB(200,255,0)
    Flat Color : Color.yellow
    Negative Movement Color : Color.RGB(255,155,0)
    Oversold Color : Color.maroon
    Super Oversold Color : Color.red

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


    Download File:
    PriceZoneOsc.efs
    PriceZoneOscWL.efs

    PriceZoneOsc.efs

    PriceZoneOscWL.efs


    EFS Code: PriceZoneOsc.efs
    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 Price Zone Oscillator 
     
    Version:            1.0  15/04/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("Price Zone Oscillator");
        
    setCursorLabelName("Price 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 
    xCls null;
    var 
    xR null;
    var 
    xCP null;
    var 
    xTC null;
    function 
    main(gPeriodgLevels)
    {

        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;     
            
        if (
    getBarState() == BARSTATE_ALLBARS)
        {
            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");
                    
    drawTextAbsolute(261"SuperBought"Color.greennullText.ONTOP Text.BOTTOM
    'Arial'10"lT60");
                    
    drawTextAbsolute(241"Overbought"Color.darkgreennullText.ONTOP Text.BOTTOM
    'Arial'10"lT40");
                    
    drawTextAbsolute(2, -41"Oversold"Color.maroonnullText.ONTOP Text.TOP
    'Arial'10"lTN40");
                    
    drawTextAbsolute(2, -61"SuperSold"Color.rednullText.ONTOP Text.TOP
    'Arial'10"lTN60");

            }
        }
        

        if (!
    bInit)
        {
            
    xCls close();
            
    xR efsInternal("calcSignedPrice"xCls);  
            
    xCP ema(gPeriodxR);
            
    xTC ema(gPeriodxCls);
            
    bInit true;
        }
        var 
    vCP xCP.getValue(0);
        var 
    vTC xTC.getValue(0);
        if ( 
    vCP == null ) return null;
        var 
    vPZO 100;  
        if ( 
    vTC != vPZO 100 vCP vTC;      

        return 
    vPZO;    
        
    }

    function 
    calcSignedPrice(xCls)
    {
            var 
    vCls xCls.getValue(0);
            var 
    vCls1 xCls.getValue(-1);
            if ( 
    vCls1 == null ) return null;
            
    vCls = (vCls1 vCls)? vCls : -vCls;
            return 
    vCls;
    }

    function 
    verify() {
        var 
    false;
        if (
    getBuildNumber() < 779) {
            
    drawTextAbsolute(535"This study requires version 8.0 or later."
                
    Color.whiteColor.blue
    Text.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.blue
    Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
                
    null13"upgrade");
            return 
    b;
        } else {
            
    true;
        }
        return 
    b;

    EFS Code: PriceZoneOscWL.efs
    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 Price Zone Oscillator for Watch List
     
    Version:            1.0  15/04/2011

    Formula Parameters:                     Default:
        Period                                14
        View Type                             Text
        Coloring Type                         Font
        Super Overbought Color                Color.green
        Overbought Color                      Color.lime 
        Positive Movement Color               Color.RGB(200,255,0)
        Flat Color                            Color.yellow
        Negative Movement Color               Color.RGB(255,155,0) 
        Oversold Color                        Color.maroon     
        Super Oversold Color                  Color.red
        
    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()
    {
        
    setCursorLabelName("Price Zone Analyzer"0);
        
        var 
    x=0;
        
    fpArray[x] = new FunctionParameter("gPeriod"FunctionParameter.NUMBER);
        
    with(fpArray[x++])
        {
        
    setName("Period");
        
    setLowerLimit(1);
            
    setDefault(14);
        }

        
    fpArray[x] = new FunctionParameter("gViewOption"FunctionParameter.STRING);
        
    with(fpArray[x++])
        {
            
    setName("View Type");
            
    addOption("Value");
            
    addOption("Text");
            
    addOption("Sign");
            
    addOption("Nothing");
            
    setDefault("Text");
        }      
        
    fpArray[x] = new FunctionParameter("gColoringOption"FunctionParameter.STRING);
        
    with(fpArray[x++])
        {
            
    setName("Coloring Type");
            
    addOption("Font");
            
    addOption("Background");
            
    addOption("No coloring");
            
    setDefault("Font");
        }      
        
    fpArray[x] = new FunctionParameter("gSOBColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Super Overbought Color");
            
    setDefault(Color.green);
        }      
        
    fpArray[x] = new FunctionParameter("gOBColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Overbought Color");
            
    setDefault(Color.lime);
        }      
        
    fpArray[x] = new FunctionParameter("gPosColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Positive Movement Color");
            
    setDefault(Color.RGB(200,255,0));
        }      

        
    fpArray[x] = new FunctionParameter("gFlatColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Flat Color");
            
    setDefault(Color.yellow);
        }      

        
    fpArray[x] = new FunctionParameter("gNegColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Negative Movement Color");
            
    setDefault(Color.RGB(255,155,0));
        }      
        
        
    fpArray[x] = new FunctionParameter("gOSColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Oversold Color");
            
    setDefault(Color.maroon);
        }      
        
    fpArray[x] = new FunctionParameter("gSOSColor"FunctionParameter.COLOR);
        
    with(fpArray[x++])
        {
            
    setName("Super Oversold Color");
            
    setDefault(Color.red);
        }      

    }

    var 
    bInit false;
    var 
    xCls null;
    var 
    xR null;
    var 
    xCP null;
    var 
    xTC null;

    var 
    servTable = new Array();
    var 
    outVal null;

    function 
    main(gPeriodgViewOptiongColoringOption
      
    gSOBColorgOBColorgPosColorgFlatColorgNegColorgOSColorgSOSColor)
    {

        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;     
            
        if (!
    bInit)
        {
            
    xCls close();
            
    xR efsInternal("calcSignedPrice"xCls);  
            
    xCP ema(gPeriodxR);
            
    xTC ema(gPeriodxCls);

            
    servTable[0] = new Array (gSOSColorgOSColorgNegColorgFlatColorgPosColorgOBColorgSOBColor);
            if (
    gViewOption == "Text"servTable[1] = new Array("SUPERSOLD""OVERSOLD""NEGATIVE"
    "FLAT""POSITIVE""OVERBOUGHT""SUPERBOUGHT");
            if (
    gViewOption == "Sign"servTable[1] = new Array("- - -"" - - ""-"
     
    "+ / -""+" ," + + ""+ + +");

            
    bInit true;
        }
        var 
    vCP xCP.getValue(0);
        var 
    vTC xTC.getValue(0);
        if ( 
    vCP == null ) return null;
        var 
    vPZO 100;  
        if ( 
    vTC != vPZO 100 vCP vTC;      
        
        var 
    cond 0
        if ( 
    vPZO >= 15 cond ;
        if ( 
    vPZO >= 40 cond ;
        if ( 
    vPZO >= 60 cond ;    
        if ( 
    vPZO <=-5  cond = -;
        if ( 
    vPZO <=-40 cond = -;    
        if ( 
    vPZO <=-60 cond = -;    

        if ( 
    gColoringOption == "Background" setBarBgColor(servTable[0][cond 3]);
        if ( 
    gColoringOption == "Font" setBarFgColor(servTable[0][cond+3]);
        if ( 
    gViewOption == "Value" outVal vPZO;
        if ( 
    gViewOption == "Text" || gViewOption == "Sign" outVal servTable[1][cond 3];
        
        return 
    outVal;    
     
    }

    function 
    calcSignedPrice(xCls)
    {
            var 
    vCls xCls.getValue(0);
            var 
    vCls1 xCls.getValue(-1);
            if ( 
    vCls1 == null ) return null;
            
    vCls = (vCls1 vCls)? vCls : -vCls;
            return 
    vCls;
    }

    function 
    verify() {
        var 
    false;
        if (
    getBuildNumber() < 779) {
            
    drawTextAbsolute(535"This study requires version 8.0 or later."
                
    Color.whiteColor.blue
    Text.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.blue
    Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
                
    null13"upgrade");
            return 
    b;
        } else {
            
    true;
        }
        return 
    b;

    Last edited by eSignal; 05-13-2011, 07:51 AM.
Working...
X