커뮤니티
문의 드립니다.
2003-08-17 00:00:00
752
글번호 630
수식언어에 대해서 컴맹수준입니다
그래서 수식표현을 정확히 하질못하겟고, 하더라두 정확한지
의구심이 자꾸 듭니다. 5이평과 10이평의 골드, 데드 기준입니다.
차트그림에 15 개 문의사항을 수식으로 표현해주십시요.
하나도 모른다구 가정하시고,
번호 1~15 를 메겨서 하나씩 답해주십시요.
초보적인것에 더헤깔리니까요.
부탁드립니다.
- 1. 1017_예91426.GIF (0.02 MB)
답변 1
예스스탁 예스스탁 답변
2003-08-19 00:00:00
안녕하세요? 예스스탁입니다....
문의하신 내용은 5일 이동평균선과 10일 이동평균선을 이용할 경우
골든 크로스 ~ 데드크로스 구간과 데드 크로스 ~ 골든 크로스 구간의 좌표값, 최고값, 이 때의 5이평 최고값, 봉의 갯수 등을 구하는 식입니다...
1. 골든/데드 크로스 시점의 좌표값
input : period(5), period1(10);
var : value(0), value1(0);
if date != date[1] then
{
value = 0;
value1 = 0;
}
if CrossUp(ma(C,period), ma(C,period1)) then
value = dayindex(); // 골든 크로스 시점의 좌표값
if CrossDown(ma(C,period), ma(C,period1)) then
value1 = dayindex(); // 데드 크로스 시점의 좌표값
plot1(value);
plot2(value1);
2. 골든 크로스 부터 데드 크로스 발생 시점 까지의 최고가
input : period(5), period1(10);
var : HighV(0), a(0), b(0);
if date != date[1] then
HighV = 0;
if ma(C,period) > ma(C,period1) && ma(C[1],period) <= ma(C[1],period1) then
HighV = H;
if accumN(iff(CrossUp(ma(C,period), ma(C,period1)),1,0),dayindex()+1) >= 1 and
ma(C,period) > ma(C,period1) and H > HighV then
HighV = H;
else
HighV = HighV;
a = mro(crossdown(ma(c,period), ma(c,period1)),500,1);
b = mro(crossdown(ma(c,period), ma(c,period1)),500,2);
plot1(HighV[a]);
plot2(HighV[b]);
위의 식은 현 시점에서 가장 최근의 골든 ~ 데드 크로스 구간의 최고값(plot1)과 두번째 최근의 골든 ~ 데드 크로스 구간의 최고값(plot2)를 구한 식입니다.
3. 골든 크로스 부터 데드 크로스 발생 구간 까지 5이평의 최고값
input : period(5), period1(10);
var : maV(0), a(0), b(0);
if date != date[1] then
maV= ma(C,period);
if ma(C,period) > ma(C,period1) && ma(C[1],period) <= ma(C[1],period1) then
maV= ma(C,period);
if accumN(iff(CrossUp(ma(C,period), ma(C,period1)),1,0),dayindex()+1) >= 1 and
ma(C,period) > ma(C,period1) and ma(C,period) > maV then
maV= ma(C,period);
else
maV= maV;
a = mro(crossdown(ma(c,period), ma(c,period1)),500,1);
b = mro(crossdown(ma(c,period), ma(c,period1)),500,2);
plot1(maV[a]);
plot2(maV[b]);
4. 골든 크로스 부터 데드 크로스 발생 구간 까지 봉의 갯수
input : period(5), period1(10);
var : value(0), value1(0), value2(0);
if date != date[1] then
{
value = 0;
value1 = 0;
value2 = 0;
}
if CrossUp(ma(C,period), ma(C,period1)) then
value = dayindex(); // 골든 크로스 시점의 좌표값
if CrossDown(ma(C,period), ma(C,period1)) then
{
value1 = dayindex(); // 데드 크로스 시점의 좌표값
value2 = value1 - value;
}
plot1(value2);
5. 골든 크로스 부터 데드 크로스 발생 시점 까지의 최고가 돌파시 매수
input : period(5), period1(10);
var : HighV(0), a(0), b(0);
if date != date[1] then
HighV = 0;
if ma(C,period) > ma(C,period1) && ma(C[1],period) <= ma(C[1],period1) then
HighV = H;
if accumN(iff(CrossUp(ma(C,period), ma(C,period1)),1,0),dayindex()+1) >= 1 and
ma(C,period) > ma(C,period1) and H > HighV then
HighV = H;
else
HighV = HighV;
a = mro(crossdown(ma(c,period), ma(c,period1)),500,1);
b = mro(crossdown(ma(c,period), ma(c,period1)),500,2);
if CrossUp(C,HighV[a]) then
buy();
6. 골든 크로스 부터 데드 크로스 발생 시점 까지의 최고가 - 1시 이후 현재까지의 최저가
input : period(5), period1(10);
var : HighV(0), a(0), b(0);
if date != date[1] then
HighV = 0;
if ma(C,period) > ma(C,period1) && ma(C[1],period) <= ma(C[1],period1) then
HighV = H;
if accumN(iff(CrossUp(ma(C,period), ma(C,period1)),1,0),dayindex()+1) >= 1 and
ma(C,period) > ma(C,period1) and H > HighV then
HighV = H;
else
HighV = HighV;
a = mro(crossdown(ma(c,period), ma(c,period1)),500,1);
b = mro(crossdown(ma(c,period), ma(c,period1)),500,2);
plot1(HighV[a] - lowest(L,dayindex()+1 - 80));
7. 데드 크로스 부터 골든 크로스 발생 시점까지의 최저값
input : period(5), period1(10);
var : LowV(0), a(0), b(0);
if date != date[1] then
LowV= 0;
if ma(C,period) < ma(C,period1) && ma(C[1],period) >= ma(C[1],period1) then
LowV= L;
if accumN(iff(CrossDown(ma(C,period), ma(C,period1)),1,0),dayindex()+1) >= 1 and
ma(C,period) < ma(C,period1) and L < LowV then
LowV= L;
else
LowV= LowV;
a = mro(crossup(ma(c,period), ma(c,period1)),500,1);
b = mro(crossup(ma(c,period), ma(c,period1)),500,2);
plot1(LowV[a]);
plot2(LowV[b]);
위의 식은 현 시점에서 가장 최근의 데드 ~ 골든 크로스 구간의 최저값(plot1)과 두번째 최근의 데드 ~ 골든 크로스 구간의 최저값(plot2)를 구한 식입니다.
8. 데드 크로스 부터 골든 크로스 발생 구간 까지 5이평의 최저값
input : period(5), period1(10);
var : maV(0), a(0), b(0);
if date != date[1] then
maV= ma(C,period);
if ma(C,period) < ma(C,period1) && ma(C[1],period) >= ma(C[1],period1) then
maV= ma(C,period);
if accumN(iff(CrossDown(ma(C,period), ma(C,period1)),1,0),dayindex()+1) >= 1 and
ma(C,period) < ma(C,period1) and ma(C,period) < maV then
maV= ma(C,period);
else
maV= maV;
a = mro(crossup(ma(c,period), ma(c,period1)),500,1);
b = mro(crossup(ma(c,period), ma(c,period1)),500,2);
plot1(maV[a]);
plot2(maV[b]);
9번 부터 15번까지의 질문은 위의 질문들과 겹치기 때문에 작성을 하지 않겠습니다....
그럼 즐거운 하루 되세요...
> 해월정 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 수식언어에 대해서 컴맹수준입니다
> 그래서 수식표현을 정확히 하질못하겟고, 하더라두 정확한지
>
> 의구심이 자꾸 듭니다. 5이평과 10이평의 골드, 데드 기준입니다.
>
> 차트그림에 15 개 문의사항을 수식으로 표현해주십시요.
>
> 하나도 모른다구 가정하시고,
>
> 번호 1~15 를 메겨서 하나씩 답해주십시요.
>
> 초보적인것에 더헤깔리니까요.
>
> 부탁드립니다.
다음글
이전글