Ergodic Candlestick Oscillator

ICE Data Services -

ECO.efs  
EFSLibrary - Discussion Board  

File Name: ECO.efs

Description:

ECO (Blau`s Ergodic Candlestick Oscillator)

Formula Parameters:

  • Number To Calculate EMA: 32
  • Number To Calculate vEMA : 12

Notes:

We call this one the ECO for short, but it will be listed on the indicator list at W. BlauRs Ergodic Candlestick Oscillator. The ECO is a momentum indicator. It is based on candlestick bars, and takes into account the size and direction of the candlestick "body". We have found it to be a very good momentum indicator, and especially smooth, because it is unaffected by gaps in price, unlike many other momentum indicators. We like to use this indicator as an additional trend confirmation tool, or as an alternate trend definition tool, in place of a weekly indicator. The simplest way of using the indicator is simply to define the trend based on which side of the "0" line the indicator is located on. If the indicator is above "0", then the trend is up. 
If the indicator is below "0" then the trend is down. You can add an additional qualifier by noting the  "slope" of the indicator, and the crossing points of the slow and fast lines. Some like to use the slope alone to define trend direction. If the lines are sloping upward, the trend is up. Alternately, if the lines are sloping downward, the trend is down. In this view, the point where the lines "cross" is the point where the trend changes.
When the ECO is below the "0" line, the trend is down, and we are qualified only to sell on new short signals from the Hi-Lo Activator. In other words, when the ECO is above 0, we are not allowed to take short signals, and when the ECO is below 0, we are not allowed to take long signals.

Download File:
ECO.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:        
    ECO (Blau`s Ergodic Candlestick Oscillator)

Version:            1.0  12/03/2008

Formula Parameters:                     Default:
    Number To Calculate EMA              32
    Number To Calculate vEMA             12

Notes:
    We call this one the ECO for short, but it will be listed on the indicator list 
    at W. Blau’s Ergodic Candlestick Oscillator. The ECO is a momentum indicator. 
    It is based on candlestick bars, and takes into account the size and direction 
    of the candlestick "body". We have found it to be a very good momentum indicator, 
    and especially smooth, because it is unaffected by gaps in price, unlike many other 
    momentum indicators.
    We like to use this indicator as an additional trend confirmation tool, or as an 
    alternate trend definition tool, in place of a weekly indicator. The simplest way 
    of using the indicator is simply to define the trend based on which side of the "0" 
    line the indicator is located on. If the indicator is above "0", then the trend is up. 
    If the indicator is below "0" then the trend is down. You can add an additional 
    qualifier by noting the "slope" of the indicator, and the crossing points of the slow 
    and fast lines. Some like to use the slope alone to define trend direction. If the 
    lines are sloping upward, the trend is up. Alternately, if the lines are sloping 
    downward, the trend is down. In this view, the point where the lines "cross" is the 
    point where the trend changes.
    When the ECO is below the "0" line, the trend is down, and we are qualified only to 
    sell on new short signals from the Hi-Lo Activator. In other words, when the ECO is 
    above 0, we are not allowed to take short signals, and when the ECO is below 0, we 
    are not allowed to take long signals. 
**********************************/

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

function preMain() {
    setStudyTitle("Blau's Candlestick Indicator"); 
    setCursorLabelName("Blau's Candlestick Indicator",0);
    setDefaultBarFgColor(Color.red,0);
    addBand(0, PS_SOLID, 1, Color.black);
    
    var x=0;
    fpArray[x] = new FunctionParameter("r", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(32);
    }
    fpArray[x] = new FunctionParameter("s", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(12);
    }
}

var xEMA = null;
var xvEMA = null;

function main(r, s) {
var nState = getBarState();

    if (nState == BARSTATE_ALLBARS) {
        if (r == null)	r = 32;
        if (s == null)	s = 12;
    }

    if ( bInit == false ) { 
        xEMA = ema(s, ema(r, efsInternal("CloseOpen")));
        xvEMA = ema(s, ema(r, efsInternal("HighLow")));
        bInit = true; 
    } 
   
    if (getCurrentBarCount() < Math.max(r,s)) return;

	if(xvEMA.getValue(0) != 0)
	    return 100 * (xEMA.getValue(0) / xvEMA.getValue(0));
	else
		return;
}

function CloseOpen() {
var nRes = 0;
    nRes = close(0) - open(0);
    if (nRes == null) nRes = 1;
    return nRes;
}

function HighLow() {
var nRes = 0;
    nRes = high(0) - low(0);
    if (nRes == null) nRes = 1;
    return nRes;
}