커뮤니티
수식문의
2011-10-11 00:04:34
525
글번호 43550
아래의 시스템수식에 의거하여
변동성이 높은 구간과 낮은 구간을 보여주는 오실레이터지표를 얻고 싶습니다.
-----------아래----------
inputs: length(20), filter(20), N(60)
//변동성(역사적변동성과 유사) 계산
TSMFCVolatility = ((ma(log(C/C[1]),length) + std(log(C/C[1]),length)) * sqrt(252));
//stochatics계산 방법 응용(TSMFCVolatility이 N개봉에서 어디에 위치하는지)
v1 = (highest(TSMFCVolatility, N) - lowest(TSMFCVolatility, N))*0.01;
if v1 <> 0 then
vola = (TSMFCVolatility - lowest(TSMFCVolatility, N) ) / v1;
else
vola=0;
condition1 = vola < filter; //변동성이 낮은 구간인지 여부
//변동성 낮은 구간에서 N봉 최고(저)가 돌파시 매수(도)
if condition1 then {
Buy("B", atstop, highest(high, length));
Sell("S", atstop, lowest(low,length));
}
if marketposition > 0 then exitlong("EL", atstop, lowest(low, length));
if marketposition < 0 then exitshort("ES", atstop,highest(high, length));
답변 1
예스스탁 예스스탁 답변
2011-10-11 11:43:08
안녕하세요
예스스탁입니다.
inputs: length(20), filter(20), N(60);
var : TSMFCVolatility(0),v1(0),vola(0);
//변동성(역사적변동성과 유사) 계산
TSMFCVolatility = ((ma(log(C/C[1]),length) + std(log(C/C[1]),length)) * sqrt(252));
//stochatics계산 방법 응용(TSMFCVolatility이 N개봉에서 어디에 위치하는지)
v1 = (highest(TSMFCVolatility, N) - lowest(TSMFCVolatility, N))*0.01;
if v1 <> 0 then
vola = (TSMFCVolatility - lowest(TSMFCVolatility, N) ) / v1;
else
vola=0;
plot1(TSMFCVolatility);
plot2(Vola);
즐거운 하루되세요
> 부똘이 님이 쓴 글입니다.
> 제목 : 수식문의
> 아래의 시스템수식에 의거하여
변동성이 높은 구간과 낮은 구간을 보여주는 오실레이터지표를 얻고 싶습니다.
-----------아래----------
inputs: length(20), filter(20), N(60)
//변동성(역사적변동성과 유사) 계산
TSMFCVolatility = ((ma(log(C/C[1]),length) + std(log(C/C[1]),length)) * sqrt(252));
//stochatics계산 방법 응용(TSMFCVolatility이 N개봉에서 어디에 위치하는지)
v1 = (highest(TSMFCVolatility, N) - lowest(TSMFCVolatility, N))*0.01;
if v1 <> 0 then
vola = (TSMFCVolatility - lowest(TSMFCVolatility, N) ) / v1;
else
vola=0;
condition1 = vola < filter; //변동성이 낮은 구간인지 여부
//변동성 낮은 구간에서 N봉 최고(저)가 돌파시 매수(도)
if condition1 then {
Buy("B", atstop, highest(high, length));
Sell("S", atstop, lowest(low,length));
}
if marketposition > 0 then exitlong("EL", atstop, lowest(low, length));
if marketposition < 0 then exitshort("ES", atstop,highest(high, length));
다음글
이전글