TFS: Tether Line

ICE Data Services -

TetherLine.efs  
EFSLibrary - Discussion Board  

File Name: TetherLine.efs

Description:
TFS: Tether Line

Formula Parameters:

  • Length: 50

Notes:

Tether line indicator is the first component of TFS trading strategy. It was named this way because stock prices have a tendency to cluster around it. It means that stock prices tend to move away from the midpoint between their 50-day highs and lows, then return to that midpoint at some time in the future. On a chart, it appears as though the stock price is tethered to this line, and hence the name.

Download File:
TetherLine.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:        
    TFS: Tether Line

Version:            1.0  09/26/2008

Notes:
    Tether line indicator is the first component of TFS trading strategy.
    It was named this way because stock prices have a tendency to cluster
    around it. It means that stock prices tend to move away from the midpoint
    between their 50-day highs and lows, then return to that midpoint at some
    time in the future. On a chart, it appears as though the stock price is
    tethered to this line, and hence the name.

Formula Parameters:                     Default:
    Length                                  50
**********************************/

var fpArray = new Array();

var bInit = false;



function preMain() {
    setPriceStudy(true);
    setStudyTitle("Tether Line");
    setCursorLabelName("Tether Line", 0);


    setDefaultBarFgColor(Color.green, 0);
    setPlotType(PLOTTYPE_LINE, 0); 
    setDefaultBarThickness(1, 0);

    
    var x=0;
    fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
    with(fpArray[x++]){
        setLowerLimit(1);  
        setDefault(50);
    }
}



var xTether = null;


function main(Length) {
var nTether = 0;
var nState = getBarState();

    if (nState == BARSTATE_ALLBARS) {
        if (Length == null) Length = 50;
    }

    if ( bInit == false ) { 
        xTether = middleDonchian(Length);
        bInit = true; 
    } 

    nTether = xTether.getValue(0);

    return nTether; 
}