IBGS

ICE Data Services -

IBGS.efs  
EFSLibrary - Discussion Board  

File Name: IBGS.efs

Description:
IBGS Indicator

Formula Parameters:

  • Up color: green
  • Down color: red

Notes:

Download File:
IBGS.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:        

    IBGS Indicator

Version:            1.0  10/03/2008

Notes:

Formula Parameters:                     Default:

    Up color                            green
    Down color                          red

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

var fpArray = new Array();

function preMain() {

    setPriceStudy(false);
    setShowCursorLabel(false);
    setShowTitleParameters( false );
    
    setStudyTitle("IBGS");
    setDefaultBarThickness(2, 0);
    setDefaultBarThickness(2, 1);

    askForInput();
    var x=0;
   
    fpArray[x] = new FunctionParameter("UpColor", FunctionParameter.COLOR);
    with(fpArray[x++]){
        setDefault(Color.green);
    }    
    
    fpArray[x] = new FunctionParameter("DownColor", FunctionParameter.COLOR);
    with(fpArray[x++]){
        setDefault(Color.red);
    }  

}

function main(UpColor, DownColor) {
    var nBarState = getBarState();
    
    if(nBarState == BARSTATE_ALLBARS) {
        UpColor = Color.green;
        DownColor = Color.red;
    }

    if (high(0) > high(-1) && close(0) < close(-1)) {
        LineColor = DownColor;
    } else if (low(0) < low(-1) && close(0) > close(-1)) {
        LineColor = UpColor;
    } else return;
    
    setBarFgColor(LineColor, 0);
    setBarFgColor(LineColor, 1);
    return new Array(high(0), low(0));
}