Stochastic SlowK

ICE Data Services -

StochasticSlowK.efs  
EFSLibrary - Discussion Board  

File Name: StochasticSlowK.efs

Description:
Stochastic SlowK

Formula Parameters:

  • Length: 14
  • OverSold: 20
  • OverBought: 80
  • SlowK in Oversold Zone: Cyan
  • SlowK in Overbought Zone: Blue

Notes:

Download File:
StochasticSlowK.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:        
    Stochastic SlowK
   
Version:            1.0  10/09/2008

Notes:

Formula Parameters:                     Default:
    Length                                 14
    OverSold                               20
    OverBought                             80
    SlowK in Oversold Zone                Cyan
    SlowK in Overbought Zone              Blue
**********************************/



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

function preMain() {
    setPriceStudy(true);
    setShowCursorLabel(false);
    setShowTitleParameters( false );
    setStudyTitle("Stochastic SlowK");
    setColorPriceBars(true); 
   
    askForInput();
    var x=0;
    fpArray[x] = new FunctionParameter("OverSColor", FunctionParameter.COLOR);
    with(fpArray[x++]){
        setName("SlowK in Oversold Zone");
        setDefault(Color.cyan);
    }    
    fpArray[x] = new FunctionParameter("OverBColor", FunctionParameter.COLOR);
    with(fpArray[x++]){
        setName("SlowK in Overbought Zone");
        setDefault(Color.blue);
    }    
    fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(14);
    }
    fpArray[x] = new FunctionParameter("OverSold", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(20);
    }
    fpArray[x] = new FunctionParameter("OverBought", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(80);
    }
}

var xStohSlowK = null;
var xStochExp = null;

function main(Length, OverSold, OverBought, OverSColor, OverBColor) {
var nMySlowK = 0;
    if ( bInit == false ) { 
        xStohSlowK = stochK(Length, 1, Length);
        xStochExp = ema(3, xStohSlowK);
        bInit = true; 
    } 
    nMySlowK = xStochExp.getValue(0);
    if (nMySlowK < OverSold) 
        setPriceBarColor(OverSColor);
    else 
        if (nMySlowK > OverBought)
            setPriceBarColor(OverBColor);
        else
            setPriceBarColor(Color.black);
    return; 
}