2005 Nov: Improve Your Trading System With Speed (Speed.efs)

ICE Data Services -

Speed.efs  
EFSLibrary - Discussion Board  

File Name: Speed.efs

Description:
This formula is based on the November 2005 article, Improve Your Trading System With Speed, by Gomu Vetrivel.

Formula Parameters:

NA

Notes:

The study plots a histogram of the speed value multiplied by 100. The histogram bar will be colored green when greater than the previous value, red when less than and grey when there is no change in speed. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.

Download File:
Speed.efs


EFS Code:

/***************************************
Provided By : eSignal (c) Copyright 2005
Description:  Improve Your Trading System With Speed - by Gomu Vetrivel

Version 1.0  9/12/2005

Notes:
November 2005 Issue of Stocks and Commodities Magazine

* Study requires version 7.9 or higher.


Formula Parameters:                 Defaults:
N/A
***************************************/

function preMain() {
    setStudyTitle("Speed ");
    setShowTitleParameters(false);
    setCursorLabelName("Speed", 0);
    setDefaultBarFgColor(Color.grey, 0);
    setDefaultBarThickness(3, 0);
    setPlotType(PLOTTYPE_HISTOGRAM, 0);
    
}

var bVersion = null;
var nSpeed = null;
var nSpeed1 = null;

//Speed = Distance traveled by price / Time taken

function main() {    

    if (bVersion == null) bVersion = verify();
    if (bVersion == false) return;    

    var nState = getBarState();
    
    if (nState == BARSTATE_NEWBAR) {
        if (nSpeed != null) nSpeed1 = nSpeed;
    }
    nSpeed = Math.abs(close(0) - close(-1)) *100;
    
    if (nSpeed > nSpeed1) setBarFgColor(Color.green);
    if (nSpeed < nSpeed1) setBarFgColor(Color.red);
    
    return nSpeed;
}


/***** Support Functions *****/

function verify() {
    var b = false;
    if (getBuildNumber() < 700) {
        drawTextAbsolute(5, 35, "This study requires version 7.9 or later.", 
            Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
            null, 13, "error");
        drawTextAbsolute(5, 20, "Click HERE to upgrade.@URL=http://www.esignal.com/download/default.asp", 
            Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
            null, 13, "upgrade");
        return b;
    } else {
        b = true;
    }
    
    return b;
}