File Name: ADX.efs
Description:
ADX Breakouts by Ken Calhoun
Formula Parameters:
ADX.efs
Length: 14
Smoothing: 14
ADX Trigger Level: 40
Notes:
The related article is copyrighted material. If you are not a subscriber
of Stocks & Commodities, please visit www.traders.com.
Download File:
ADX.efs
ADX.efs
EFS Code:
Description:
ADX Breakouts by Ken Calhoun
Formula Parameters:
ADX.efs
Length: 14
Smoothing: 14
ADX Trigger Level: 40
Notes:
The related article is copyrighted material. If you are not a subscriber
of Stocks & Commodities, please visit www.traders.com.
Download File:
ADX.efs
ADX.efs
EFS Code:
PHP Code:
/*********************************
Provided By:
eSignal (Copyright c eSignal), a division of Interactive Data
Corporation. 2016. 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:
ADX Breakouts by Ken Calhoun
Version: 1.00 01/11/2016
Formula Parameters: Default:
Length 14
Smoothing 14
ADX Trigger Level 40
Notes:
The related article is copyrighted material. If you are not a subscriber
of Stocks & Commodities, please visit www.traders.com.
**********************************/
var fpArray = new Array();
function preMain(){
setPriceStudy(false);
setStudyTitle("ADX Breakouts");
setCursorLabelName("ADX",0);
var x=0;
fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(14);
}
fpArray[x] = new FunctionParameter("Smoothing", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(14);
}
fpArray[x] = new FunctionParameter("TriggerLevel", FunctionParameter.NUMBER);
with(fpArray[x++]){
setName("ADX Trigger Level");
setLowerLimit(1);
setDefault(40);
}
}
var bInit = false;
var xADX = null;
var vLongFlag = false;
var vLongFlag1 = false;
var vFullDate = 0
var vTriggerDate;
var bVersion = null;
function main(Length, Smoothing, TriggerLevel){
if (bVersion == null) bVersion = verify();
if (bVersion == false) return;
if(getBarState() == BARSTATE_ALLBARS){
bInit = false;
}
if (!bInit){
xADX = adx(Length,Smoothing);
addBand(TriggerLevel, PS_SOLID, 1, Color.lightgrey, "Trigger")
vLongFlag = false;
vLongFlag1 = false;
vFullDate = 0;
bInit = true;
}
if(xADX.getValue(-1) == null) return;
if( getBarState() == BARSTATE_NEWBAR){
var oBarDate = getValue("time");
var vYear = oBarDate.getFullYear().toString();
var vMonth = (oBarDate.getMonth()+1) < 10? "0"+(oBarDate.getMonth()+1): oBarDate.getMonth()+1;
var vDate = oBarDate.getDate() < 10? "0"+oBarDate.getDate(): oBarDate.getDate();
vFullDate = (vYear+vMonth+vDate)*1;
vLongFlag1 = vLongFlag;
}
if(xADX.getValue(0) > TriggerLevel && xADX.getValue(-1) < TriggerLevel){
vTriggerDate = vFullDate;
vLongFlag = true;
drawTextRelative(0, TriggerLevel-2.00, "\u00E1", Color.green, null, Text.TOP|Text.CENTER, "Wingdings", 10, "UpArrow"+rawtime(0));
} else{
vLongFlag = vLongFlag1
removeText("UpArrow"+rawtime(0))
}
if(day(0)!=day(-1) && vFullDate >= vTriggerDate+1 && vLongFlag){
var nHigh = formatPriceNumber(high(-1, inv("d"))+0.50);
drawText("Suggested Long Entry at "+nHigh,TopRow1,Color.green,Text.LEFT,"Text"+rawtime(0));
vLongFlag = false;
}
return xADX.getValue(0);
}
function verify(){
var b = false;
if (getBuildNumber() < 779){
drawTextAbsolute(5, 35, "This study requires version 12.1 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;
}