in the following formula by ts support how can i turn the trend line into a variable which can then be used in a statement . ?
if you know what i mean,
/************************************************** *****************
Provided By : TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
function preMain()
{
setStudyTitle("Movtrend");
setCursorLabelName("Movtrend", 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(2);
setPriceStudy(true);
}
function main(n) {
if(n == null)
n = 20;
var sum = 0;
var i = 0;
var mt = 0;
for(i = n; i > 0; i--)
sum += (i - (n + 1) / 3) * close(i - n);
wt = 6 / (n * (n + 1)) * sum
return wt;
}
if you know what i mean,
/************************************************** *****************
Provided By : TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
function preMain()
{
setStudyTitle("Movtrend");
setCursorLabelName("Movtrend", 0);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarThickness(2);
setPriceStudy(true);
}
function main(n) {
if(n == null)
n = 20;
var sum = 0;
var i = 0;
var mt = 0;
for(i = n; i > 0; i--)
sum += (i - (n + 1) / 3) * close(i - n);
wt = 6 / (n * (n + 1)) * sum
return wt;
}
Comment