GetXTLStudy

ICE Data Services -

GetXTLStudy()Advanced GET Study Functions

Creates object, which allows to get values of indicator Advanced GET XTL in EFS scripts. The XTL (eXpert Trend Locator) is a proprietary study Tom Joseph developed that uses a statistical evaluation of the market that can tell the difference between random market swings (noise) and directed market swings (trends).

 

Syntax

GetXTLStudy( nLength )


Parameters

Parameter: Description: Default:
nLength The number of bars used to calculate the XTL. n/a


Member(s)

Syntax: Returned value:
GetXTLStudy.XTL Return values:
0 = Down Trend,
1 = Up Trend,
2 = Neutral  


Notes

Only available in versions 7.9 or later.


Code Example

Advanced GET XTL Indicator:
var fpArray = new Array();

function preMain(){
	askForInput();
	setDefaultBarFgColor(Color.grey, 0);
	setStudyTitle("AGET XTL");
	setCursorLabelName("XTL", 0);
	setPriceStudy(true);
	setColorPriceBars(true);
	setShowSeries(false, 0);
	var x = 0;
	fpArray[x] = new FunctionParameter("nPeriod", FunctionParameter.NUMBER);
	with(fpArray[x++])	{
		setName("Length");
		setLowerLimit(1);
		setDefault(35);
	}
	fpArray[x] = new FunctionParameter("gColorUp", FunctionParameter.COLOR);
	with(fpArray[x++])
	{
		setName("Up Color");
		setDefault(Color.blue);
	}
	fpArray[x] = new FunctionParameter("gColorDn", FunctionParameter.COLOR);
	with(fpArray[x++])	{
		setName("Down Color");
		setDefault(Color.red);
	}
	fpArray[x] = new FunctionParameter("gColorNt", FunctionParameter.COLOR);
	with(fpArray[x++])	{
		setName("Neutral Color");
		setDefault(Color.grey);
	}
}
var vXTL = null;

function main(nPeriod, gColorUp, gColorDn, gColorNt){
	if (vXTL == null) vXTL = new GetXTLStudy(nPeriod);
	var valXTL = vXTL.getValue(GetXTLStudy.XTL);
	if (valXTL == 1) setPriceBarColor(gColorUp)
	else if (valXTL == 2) setPriceBarColor(gColorNt)
	else	{
		valXTL = 0;
		setPriceBarColor(gColorDn)
	};
	return valXTL.toFixed(0);
}

See Also


Advanced GET Studies