Code: Select all
input: length ( 10 );
Vars: Ratio ( 0 ), TSI ( 0 );
Ratio = absvalue((close - close[length]))/averagetruerange(length);
TSI = Average(Average(Ratio,length),100);
Plot1(TSI, "TSI");
Plot2(1.65 , "Boundary");
Code: Select all
input: length ( 10 );
Vars: Ratio ( 0 ), TSI ( 0 );
Ratio = absvalue((close - close[length]))/averagetruerange(length);
TSI = Average(Average(Ratio,length),100);
Plot1(TSI, "TSI");
Plot2(1.65 , "Boundary");
re: Is there ever a time here where the average true range will be 0??I have had it plot fine before but now over longer data i cant understand why. Is there ever a time here where the average true range will be 0?? its the only divisor. I am using 5 min charts of YM for past 10 years if anyone can replicate.
Code: Select all
input: length ( 10 );
Vars: Ratio ( 0 ), TSI ( 0 );
Ratio = absvalue((close - close[length]))/averagetruerange(length);
TSI = Average(Average(Ratio,length),100);
Plot1(TSI, "TSI");
Plot2(1.65 , "Boundary");
Code: Select all
input: length ( 10 );
Vars: Ratio ( 0 ), TSI ( 0 ), denom(0);
denom = averagetruerange(length);
if denom = 0 then
ratio = 0
else
Ratio = absvalue((close - close[length]))/ denom;
TSI = Average(Average(Ratio,length),100);
Plot1(TSI, "TSI");
Plot2(1.65 , "Boundary");
Code: Select all
denom = Average(Truerangecustom(high data2, low data2, close data2), length);
if denom = 0 then
ratio = 0
else
Ratio = absvalue((close data2 - close[length] data2))/ denom;
TSI = Average(Average(Ratio,length),100);
Print(Date, TSI);
see post #5Sorry, another quick question. I am trying to get that to take the data from data 2. But i keep getting wrong results. I used a print and output debug already. I also tried to use the custom true range function as well. But i don't think its calculating correctly. Is there a way to use the averagetruerange function with data2? i saw the only input you can give it is length.
Code: Select all
denom = Average(Truerangecustom(high data2, low data2, close data2), length);
if denom = 0 then
ratio = 0
else
Ratio = absvalue((close data2 - close[length] data2))/ denom;
TSI = Average(Average(Ratio,length),100);
Print(Date, TSI);