Announcement

Collapse
No announcement yet.

Typical Price

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

  • Typical Price

    File Name: TypicalPrice.efs

    Description:
    Typical Price

    Formula Parameters:
    Typical Price: Blue
    AVG: Red
    Length: 9
    Typical Price Thickness: 1
    AVG Thickness: 1
    Display Title Value: False


    Notes:
    The Typical Price for each bar is calculated as an average of 3 values:
    high, low and close. This value is then plotted on the chart. An average
    of the Typical Price from the most recent number of bars specified by the
    input Length is also plotted. Using the Typical Price instead of the close
    in calculating and plotting, say, a moving average weighs the high and low
    into the calculation.
    This indicator can be used in a manner similar to the Mov Avg 2 Lines,
    with attention given to the direction and relative position of prices,
    Typical Price and the average of the Typical Price. (Typical Price is
    known to some traders as the pivot point.)


    Download File:
    TypicalPrice.efs



    EFS Code:
    PHP Code:
    /*********************************
    Provided By:  
        eSignal (Copyright c eSignal), a division of Interactive Data 
        Corporation. 2008. All rights reserved. This sample eSignal 
        Formula Script (EFS) is for educational purposes only and may be 
        modified and saved under a new file name.  eSignal is not responsible
        for the functionality once modified.  eSignal reserves the right 
        to modify and overwrite this EFS file with each new release.
      

    Description:        
        Typical Price 


    Version:            1.0  08/08/2008

    Notes:
        The Typical Price for each bar is calculated as an average of 3 values:
        high, low and close. This value is then plotted on the chart. An average
        of the Typical Price from the most recent number of bars specified by the
        input Length is also plotted. Using the Typical Price instead of the close
        in calculating and plotting, say, a moving average weighs the high and low
        into the calculation.
        This indicator can be used in a manner similar to the Mov Avg 2 Lines,
        with attention given to the direction and relative position of prices,
        Typical Price and the average of the Typical Price. (Typical Price is 
        known to some traders as the pivot point.)

    Formula Parameters:                     Default:
        * Typical Price                     Blue
           Color of Typival Price line
        * AVG                               Red  
           Color of AVG line
        * Length                            9
        * Typical Price Thickness           1
        * AVG Thickness                     1
        * Display Title Value               False

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

    var fpArray = new Array();
    var 
    bInit false;
    var 
    TypPrice null;

    function 
    preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Typical Price ");
        
    setCursorLabelName("TypicalPrice"0);
        
    setCursorLabelName("AVG"1);    
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.red1);    
        
    setPlotType(PLOTTYPE_LINE0); 
        
    setPlotType(PLOTTYPE_LINE1);     
        
    setDefaultBarThickness(10);
        
    setDefaultBarThickness(11);    

        
    askForInput();

        var 
    x=0;
        
    fpArray[x] = new FunctionParameter("LineColor1"FunctionParameter.COLOR);
        
    with(fpArray[x++]){
            
    setName("Typical Price");
            
    setDefault(Color.blue);
        }    


        
    fpArray[x] = new FunctionParameter("LineColor2"FunctionParameter.COLOR);
        
    with(fpArray[x++]){
            
    setName("AVG");
            
    setDefault(Color.red);
        }    

        
    fpArray[x] = new FunctionParameter("Length"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setLowerLimit(1);        
            
    setDefault(9);
        }

        
    fpArray[x] = new FunctionParameter("LineThickness1"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("Typical Price Thickness");
            
    setLowerLimit(1);        
            
    setDefault(1);
        }

        
    fpArray[x] = new FunctionParameter("LineThickness2"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("AVG Thickness");    
            
    setLowerLimit(1);        
            
    setDefault(1);
        }

        
    fpArray[x] = new FunctionParameter("ViewValue"FunctionParameter.BOOLEAN);
        
    with(fpArray[x++]){
           
    setName("Display Title Value");
           
    setDefault(false);
        }    
    }



    function 
    main(LengthLineColor1LineThickness1LineColor2LineThickness2ViewValue) {
    var 
    nTypPrice;
    var 
    nAFC;

       if ( 
    bInit == false ) { 
            
    setDefaultBarFgColor(LineColor10);
            
    setDefaultBarFgColor(LineColor21);    
            
    setDefaultBarThickness(LineThickness10);
            
    setDefaultBarThickness(LineThickness21);    
            
    TypPrice hlc3();
            
    xAFC sma(Length,TypPrice);
            
    setShowTitleParametersViewValue );
            
    bInit true
        } 

        
        
    nTypPrice TypPrice.getValue(0);
        
    nAFC xAFC.getValue(0);
       
        if(
    nTypPrice==null||nAFC==null) return;

        return new Array (
    nTypPricenAFC); 

Working...
X