Announcement

Collapse
No announcement yet.

2006 Jul: The Wilson Relative Price Channel by Leon Wilson

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

  • 2006 Jul: The Wilson Relative Price Channel by Leon Wilson

    File Name: Wilson_RPC.efs

    Description:
    This study is based on the July 2006 article, The Wilson Relative Price Channel, by Leon Wilson

    Formula Parameters:
    Channel Periods: 34
    Smoothing Periods: 1
    Over Bought: 70
    Over Sold: 30
    Upper Neutral Zone: 55
    Lower Neutral Zone: 45


    Notes:
    This formula requires eSignal version 7.9.1 or later. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.


    Download File:
    Wilson_RPC.efs



    EFS Code:
    PHP Code:
    /***************************************
    Provided By : eSignal (c) Copyright 2006
    Description:  The Wilson Relative Price Channel
                  by Leon Wilson

    Version 1.0  05/05/2006

    Notes:
    * July 2006 Issue of Stocks and Commodities Magazine
    * Study requires version 7.9.1 or higher.


    Formula Parameters:                 Defaults:
    Channel Periods                     34
    Smoothing Periods                   1
    Over Bought                         70
    Over Sold                           30
    Upper Neutral Zone                  55
    Lower Neutral Zone                  45
    ***************************************/


    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("The Wilson Relative Price Channel ");
        
    setCursorLabelName("Over Bought"0);
        
    setCursorLabelName("Neutral Upper"1);
        
    setCursorLabelName("Neutral Lower"2);
        
    setCursorLabelName("Over Sold"3);
        
    setShowTitleParameters(false);
        
    setDefaultBarFgColor(Color.black0);
        
    setDefaultBarFgColor(Color.black1);
        
    setDefaultBarFgColor(Color.black2);
        
    setDefaultBarFgColor(Color.black3);
        
    setPlotType(PLOTTYPE_SQUAREWAVE0);
        
    setPlotType(PLOTTYPE_SQUAREWAVE1);
        
    setPlotType(PLOTTYPE_SQUAREWAVE2);
        
    setPlotType(PLOTTYPE_SQUAREWAVE3);
        

        var 
    fp1 = new FunctionParameter("nPeriods"FunctionParameter.NUMBER);
            
    fp1.setName("Channel Periods");
            
    fp1.setLowerLimit(1);
            
    fp1.setUpperLimit(250);
            
    fp1.setDefault(34);
        var 
    fp2 = new FunctionParameter("nSmoothing"FunctionParameter.NUMBER);
            
    fp2.setName("Smoothing Periods");
            
    fp2.setLowerLimit(1);
            
    fp2.setUpperLimit(55);
            
    fp2.setDefault(1);
        var 
    fp3 = new FunctionParameter("nOB"FunctionParameter.NUMBER);
            
    fp3.setName("Over Bought");
            
    fp3.setLowerLimit(50);
            
    fp3.setUpperLimit(99);
            
    fp3.setDefault(70);
        var 
    fp4 = new FunctionParameter("nOS"FunctionParameter.NUMBER);
            
    fp4.setName("Over Sold");
            
    fp4.setLowerLimit(1);
            
    fp4.setUpperLimit(50);
            
    fp4.setDefault(30);
        var 
    fp5 = new FunctionParameter("nUpperNZ"FunctionParameter.NUMBER);
            
    fp5.setName("Upper Neutral Zone");
            
    fp5.setLowerLimit(50);
            
    fp5.setUpperLimit(99);
            
    fp5.setDefault(55);
        var 
    fp6 = new FunctionParameter("nLowerNZ"FunctionParameter.NUMBER);
            
    fp6.setName("Lower Neutral Zone");
            
    fp6.setLowerLimit(1);
            
    fp6.setUpperLimit(50);
            
    fp6.setDefault(45);
    }

    var 
    bVersion null;
    var 
    bInit false;

    var 
    xRPC null;

    function 
    main(nPeriodsnSmoothingnOBnOSnUpperNZnLowerNZ) {    
        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;    

        if (
    bInit == false) {
            
    xRPC efsInternal("calcRPC"nPeriodsnSmoothingnOBnOSnUpperNZnLowerNZ);
            
    bInit true;
        }
        
        var 
    nRPC_OB getSeries(xRPC0);  // Over Bought
        
    var nRPC_UN getSeries(xRPC1);  // Upper Neutral
        
    var nRPC_LN getSeries(xRPC2);  // Lower Neutral
        
    var nRPC_OS getSeries(xRPC3);  // Over Sold

        
    setBarBgColor(Color.lightgrey0nRPC_UNnRPC_OB);
        
    setBarBgColor(Color.grey2nRPC_LNnRPC_OS);

        return new Array(
    nRPC_OBnRPC_UNnRPC_LNnRPC_OS);
    }

    function 
    calcRPC(nPeriodsnSmoothingnOBnOSnUpperNZnLowerNZ) {
        var 
    nC close(0);
        var 
    OB ema(nSmoothingefsInternal("calcCord"nPeriodsnOB),      0);
        var 
    UN ema(nSmoothingefsInternal("calcCord"nPeriodsnUpperNZ), 0);
        var 
    LN ema(nSmoothingefsInternal("calcCord"nPeriodsnLowerNZ), 0);
        var 
    OS ema(nSmoothingefsInternal("calcCord"nPeriodsnOS),      0);
        
        
    OB nC - (nC * (OB/100));
        
    UN nC - (nC * (UN/100));
        
    LN nC - (nC * (LN/100));
        
    OS nC - (nC * (OS/100));
        
        return new Array(
    OBUNLNOS);
    }


    function 
    calcCord(nPeriodsnCord) {
        return (
    rsi(nPeriods0) - nCord);
    }


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