ALEX IS THERE A WAY TO PUT IN BUY,SELL TAGS WHEN A HIGH AND A LOW ARE REACHED IN A 20 BAR PERIOD?// Provided by eSignal (c) 2003 //
////////////////////////////////////////////////////////////////
function preMain()
{
setStudyTitle("Linear Regression Indicator");
setCursorLabelName("LR", 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(3, 0);
setPriceStudy(true);
}
function main(Length) {
if(Length == null) Length = 5;
var sum = 0;
var i = 0;
var mt = 0;
var wt = 0;
for(i = Length; i > 0; i--)
sum += (i - (Length + 1) / 3) * close(i - Length);
wt = 6 / (Length * (Length + 1)) * sum
return wt;
////////////////////////////////////////////////////////////////
function preMain()
{
setStudyTitle("Linear Regression Indicator");
setCursorLabelName("LR", 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(3, 0);
setPriceStudy(true);
}
function main(Length) {
if(Length == null) Length = 5;
var sum = 0;
var i = 0;
var mt = 0;
var wt = 0;
for(i = Length; i > 0; i--)
sum += (i - (Length + 1) / 3) * close(i - Length);
wt = 6 / (Length * (Length + 1)) * sum
return wt;
Comment