함수설명
TSI((True Strength Index) 지표함수
작성방법
TSI(기준값, 기간1, 기간2, 기간3)
C
복사
매개변수 설명
•
"기준값": Numeric, 데이터, 함수, 변수, 계산식 등
•
"기간1": Numeric, 평활계수를 계산할 기간으로 1차 지수이동평균 계산에 사용
•
"기간2": Numeric, 평활계수를 계산할 기간으로 2차 지수이동평균 계산에 사용
•
"기간3": Numeric, 평활계수를 계산할 기간으로 3차 지수이동평균 계산에 사용
계산
VV = 기준값- 직전봉기준값
A1 = VV의 기간1 지수이동평균
A2 = A1의 기간2 지수이동평균
A3 = A2의 기간3 지수이동평균
B1 = VV 절대값의 기간1 지수이동평균
B2 = B1의 기간2 지수이동평균
B3 = B2의 기간3 지수이동평균
TSI = A3/B3*100
활용예시
//인라인함수(수식안에서 만들어 사용하는 함수)
//TSI 함수식
Function infx_TXAverage Numeric
{
Inputs : Price(NumericSeries), r(NumericSimple), s(NumericSimple), u(NumericSimple);
infx_TXAverage = Ema(Ema(Ema(Price, r), s), u) ;
}
EndFunction
//TSI 함수식
Function infx_TSI Numeric
{
Input : Price(NumericSeries), r(NumericSimple), s(NumericSimple), u(NumericSimple);
VAR : value1(0), value2(0);
Value1 = 100 * infx_TXAverage(Price - Price[1], r, s, u) ;
Value2 = infx_TXAverage(Abs(Price - Price[1]), r, s, u) ;
If Value2 <> 0 then
infx_TSI = Value1 / Value2;
Else
infx_TSI = 0;
}
EndFunction
INPUTS: R(4), S(8), U(6),SMTHLEN(10), ZEROLINE(0);
var : Truestrength(0),Truestrengthsig(0);
Truestrength = infx_TSI(C, R, S, U);
Truestrengthsig = Ema(Truestrength, SMTHLEN);
PLOT1(Truestrength, "TSI");
PLOT2(Truestrengthsig, "Signal");
PLOTBASELINE1(ZEROLINE," 기준선 0");
C
복사
뒤로가기는 좌측상단의 목차 버튼을 눌러주세요.