SymbolCompareAsNPS2.efs

ICE Data Services -

SymbolCompareAsNPS2.efs    

File Name: SymbolCompareAsNPS2.efs

Description:
Compare a symbol to your chart symbol as a non-price study with H/L bars.

Formula Parameters:

  • Symbol: Any valid symbol (Spread symbols are not valid for this formula).
  • Number of Bars: Default is 200. Max/Min Limits: 200/1
  • Bar Thickness: Default is 2. Controls the thickness of the H/L bars.
  • Up Bar Color: Default is green.
  • Neutral Bar Color: Default is grey.
  • Down Bar Color: Default is red.

Notes:
After applying the formula, go to "Edit Studies" and enter a symbol. The formula also draws the high/Low bars and the open, similar to a bar chart.

 

Download File:
SymbolCompareAsNPS2_EFS2.efs (Requires Version 7.9 or later)
SymbolCompareAsNPS2.efs


EFS Code:

/***************************************************************
Copyright © eSignal, a division of Interactive Data Corporation. 2005

EFS2 version of SymbolCompareAsNPS.efs
Requires eSignal version 7.9 or later.

The study has been updated to utilize EFS2 functions to handle syncronization
between symbols that have different trading hours.

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

var vLoaded = false;
var cSym = "";
var vSym = null;

function preMain() {
    if (vLoaded == false) {    
        setStudyTitle(" ... Add Symbol");
        setCursorLabelName("Add Symbol");
        setDefaultBarFgColor(Color.red);
    } else {
        if (vSym != null) {
            setStudyTitle(cSym + " vs. ");
            setCursorLabelName(vSym);
        } else {
            setStudyTitle(" ... Add Symbol");        
            setCursorLabelName("Add Symbol");
        }
    }
}

function main(Symbol1) {
    if (vLoaded == false) {
        cSym = getSymbol();
        if  (Symbol1 == null) {
            vSym = null;
        } else {
            vSym = Symbol1;
        }
        vLoaded = true;
        preMain();
    }

    if (vSym != null) {
        var b = close(sym(vSym));
        return b;
    } else {
        return;
    }
}