File Name: VolumePRV.efs

Description:
Volume PRV

Formula Parameters:
Line Thickness: 2
Color PRV: Lime
Volume Up Color: Black
Volume Down Color: Red
Volume EQ Color: Magenta
Display Cursor Labels: True


Notes:
Pro Rata Volume is an estimate of what the Bar's final Volume will be.

Download File:
VolumePRV.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:        
    Volume PRV

Version:            1.0  10/06/2008

Notes:
    Pro Rata Volume is an estimate of what the Bar's final Volume will be.
    
Formula Parameters:                     Default:
    Line Thickness                          2
    Color PRV                             Lime
    Volume Up Color                       Black
    Volume Down Color                     Red
    Volume EQ Color                       Magenta
    Display Cursor Labels                 True
**********************************/

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

function 
preMain() {

    
setPriceStudy(false);
    
setShowCursorLabel(false);
    
setShowTitleParametersfalse );
    
    
setStudyTitle("Volume PRV");
    
setCursorLabelName("Volume"0);    

    
setDefaultBarFgColor(Color.red0);
    
setPlotType(PLOTTYPE_HISTOGRAM0); 
    
setDefaultBarThickness(20);
    

   
    
askForInput();
    var 
x=0;
    
fpArray[x] = new FunctionParameter("LineColor1"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Color PRV");
        
setDefault(Color.lime);
    }    


    
fpArray[x] = new FunctionParameter("ViewValue"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Display Cursor Labels");
        
setDefault(true);
    }    
    

    
fpArray[x] = new FunctionParameter("Thickness"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Line Thickness");
        
setLowerLimit(1);        
        
setDefault(2);
    }
    
    
fpArray[x] = new FunctionParameter("PRICEUp"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Volume Up Color");
        
setDefault(Color.black);
    }    

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

    
fpArray[x] = new FunctionParameter("PRICEEqual"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Volume EQ Color");
        
setDefault(Color.magenta);
    }    
    
    
}

var 
nHour 0;
var 
nMinute 0;
var 
nSecond 0;



function 
main(ThicknessLineColor1PRICEUpPRICEDownPRICEEqualViewValue) {
var 
nState getBarState();
var 
nEndTime 0;
var 
nVolume 0;
var 
vInt = (getInterval()*60);  
var 
PercentComplete 0;


    if ( 
bInit == false ) { 
        
setDefaultBarFgColor(LineColor10);
        
setDefaultBarThickness(Thickness0);
        
setShowCursorLabel(ViewValue);        
        
bInit true
    } 



    if (!
isIntraday()) {
        
setStudyTitle("Sorry. This script run only intraday charts.");
        return;
    } else {
        if (
getCurrentBarCount() == getNumBars()) {
            
setStudyTitle("Volume PRV");

            
Timer();
            
nEndTime = (nHour 3600) + (nMinute 60) + nSecond;  

            
PercentComplete =  (- ((nEndTime 100 vInt) * 0.01));
            
            if (
PercentComplete 0.02)
                
nVolume volume(0)
            else
                
nVolume Math.floor(volume(0) / PercentComplete);  
       
            if (
nVolume volume(0)) nVolume volume(0);
        } else {
            
nVolume volume(0);
        }
    }

    
drawLineRelative000nVolumePS_SOLIDThicknessLineColor1105 ); 

    if (
close(0) > close(-1)) {
        
setDefaultBarFgColor(PRICEUp0);
        
drawLineRelative000volume(0), PS_SOLIDThicknessPRICEUp106 ); 
    } else
        if (
close(0) < close(-1)) {
            
setDefaultBarFgColor(PRICEDown0);
            
drawLineRelative000volume(0), PS_SOLIDThicknessPRICEDown106 ); 
         } else {
            
setDefaultBarFgColor(PRICEEqual0);
            
drawLineRelative000volume(0), PS_SOLIDThicknessPRICEEqual106 ); 
        }    


    return 
volume(0); 
}

var 
vTimeStamp null;
var 
vInt null;

function 
Timer() {
    if (!
isIntraday() || getCurrentBarIndex() < -1) return;
    var 
nState getBarState();
    var 
vClockTime = new Date()*1;
    
    if (
vInt == nullvInt = (getInterval()*60000);  // convert to milliseconds
    
if (nState == BARSTATE_NEWBAR) {
        
vTimeStamp getValue("Time")*vInt;
    }

    var 
vTimeLeft = (vTimeStamp vClockTime);
    if (
vTimeLeft 0) return;

    var 
vHr 0;
    var 
vMin 0;
    var 
vSec 0;
    
    if (
vInt 3600000) {
        
vHr Math.floor(vTimeLeft/3600000);
        
vTimeLeft -= (vHr*3600000);
    }
    if (
vInt 60000) {
        
vMin Math.floor(vTimeLeft/60000);
        
vTimeLeft -= (vMin*60000);
    }
    
vSec Math.floor(vTimeLeft/1000);
    
    
vTimeLeft = (" " vHr ":" vMin ":" vSec " ");

    
nHour vHr;
    
nMinute vMin;
    
nSecond vSec;

    return;