File Name: BreadthThrust.efs
Description:
Breadth Thrust
Formula Parameters:
Exchange : NYSE
Length : 10
Notes:
Download File:
BreadthThrust.efs
EFS Code:
Description:
Breadth Thrust
Formula Parameters:
Exchange : NYSE
Length : 10
Notes:
Download File:
BreadthThrust.efs
EFS Code:
PHP Code:
/*********************************
Provided By:
eSignal (Copyright c eSignal), a division of Interactive Data
Corporation. 2009. 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:
Breadth Thrust
Version: 1.0 07/06/2009
Formula Parameters: Default:
Exchange NYSE
Length 10
Notes:
**********************************/
var fpArray = new Array();
var bInit = false;
function preMain(){
setPriceStudy(false);
setStudyTitle("Breadth Thrust");
setCursorLabelName("Thrust");
var x=0;
fpArray[x] = new FunctionParameter("sExchange", FunctionParameter.STRING);
with(fpArray[x++]){
setName("Exchange");
addOption("NYSE");
addOption("NASDAQ");
setDefault("NYSE");
}
fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(10);
}
}
var xBreadthThrust = null;
function main(sExchange, Length){
var nBarState = getBarState();
if (nBarState == BARSTATE_ALLBARS) {
if (sExchange == null) sExchange = "NYSE";
if (Length == null) Length = 10;
}
if(!bInit){
xBreadthThrust = sma(Length, efsInternal("Calc_Thrust", sExchange));
}
return xBreadthThrust.getValue(0);
}
var xAdvance = null;
var xDecline = null;
function Calc_Thrust(_exchange){
if(getBarState() == BARSTATE_ALLBARS){
if(_exchange == "NYSE"){
xAdvance = close(sym("$ADV"));
xDecline = close(sym("$DECL"));
}else if(_exchange == "NASDAQ"){
xAdvance = close(sym("$ADVQ"));
xDecline = close(sym("$DECLQ"));
}
}
if(xAdvance.getValue(0) == null || xDecline.getValue(0) == null) return;
if((xAdvance.getValue(0) != 0 && xAdvance.getValue(0)+xDecline.getValue(0)) != 0)
var Thrust = xAdvance.getValue(0) / (xAdvance.getValue(0)+xDecline.getValue(0));
return Thrust;
}