Volume TriColor

ICE Data Services -

VolumeTriColor.efs  
EFSLibrary - Discussion Board  

File Name: VolumeTriColor.efs

Description:
Volume TriColor

Formula Parameters:

  • Volume Up Color: Black
  • Volume Down Color: Red
  • Volume EQ Color: Magenta

Notes:
Volume is simply the number of shares (or contracts) traded during a specified time frame (e.g. hour, day, week, month, etc).

Download File:
VolumeTriColor.efs


EFS 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 TriColor

Version:            1.0  10/04/2008

Notes:
    Volume is simply the number of shares (or contracts) traded during a specified time
    frame (e.g. hour, day, week, month, etc).

Formula Parameters:                     Default:
    Volume Up Color                       Black
    Volume Down Color                     Red
    Volume EQ Color                       Magenta

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

var fpArray = new Array();

function preMain() {

    setPriceStudy(false);
    setShowCursorLabel(true);
    setShowTitleParameters( false );
    
    setStudyTitle("Volume TriColor");
    setCursorLabelName("VTC", 0);

    setDefaultBarFgColor(Color.black, 0);
    setPlotType(PLOTTYPE_HISTOGRAM, 0); 
    setDefaultBarThickness(2, 0);

   
    askForInput();
    var x=0;
    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);
    }    



}

function main(PRICEUp, PRICEDown, PRICEEqual) {

	if (getCurrentBarCount < 1)
        setDefaultBarFgColor(Color.black, 0);
	
    if (close(0) > close(-1))		
		setDefaultBarFgColor(PRICEUp, 0);
	else
        if (close(0) < close(-1))
            setDefaultBarFgColor(PRICEDown, 0);
 		else 
            setDefaultBarFgColor(PRICEEqual, 0);
      
    return volume(0); 
}