커뮤니티
식 수정부탁..
2011-06-23 19:14:22
683
글번호 40092
19286질문에 대하여 아래와 같이 답글 잘 보았습니다.
그런데 제가 의도했던 것과 다른 부분이 있어 그 아래 질문 내용에 맞게 수정 부탁드립
니다.
---------------------------------------------------------------------------------
var5와 var6이 특별한 제어가 없어 해당시간이후에
조건만 만족하면 값이 갱신되므로
최초 한번만 저장하도록 하고 수식에 사용되는
내부변수를 각 주기를 쫒아가도록 변경했습니다.
주석을 참고하시기 바랍니다.
var : cond3(false,data3),cond4(false,data3);
var : D1H1(0,data1),D1H2(0,data1),D3H1(0,data3),D3H2(0,data3);
#data3의 첫봉에 각변수 false로 초기화
If Data3(sDate!=sDate[1]) Then{
cond3 = False;
cond4 = False;
}
#data1기준 10시 10시30분 고가 저장
if data1(sTime==100000) Then
D1H1=data1(H);
if data1(sTime==103000) Then
D1H2=data1(H);
#data3기준 10시 10시30분 고가 저장
if data3(sTime==100000) Then
D3H1 =data3(H);
if data3(sTime==103000) Then
D3H2 = data3(H);
#data3-10시 30분이후 종가가 10시와 10시 30분 고가보다 큰봉 나오면 cond4 true
If Data3(c > D3H1 and c > D3H2 and stime>103000) and Cond4 == false Then
Cond4 = true;
# cond4가 ture이고 12시이전에 종가가 2.0보다 큰봉이 나오면 cond3은 true
if Cond4 == true and data3(stime <= 120000 and C >= 2.0) Then
cond3 = true;
If MarketPosition == 0 and count<1 and data1(stime>103000 and stime<=120000) Then {
If data1(c>1.5 and c<=2.0 and c>D1H1 and c > D1H2 and c > o) Then {
If c<data2(c) and c<data3(c) and cond3==true Then #cond3 true일때 다른조건 만족하면 진입
buy("매수",onclose,DEF,2);
}
}
---------------------------------------------------------------------------------
위 식중,
# cond4가 ture이고 12시이전에 종가가 2.0보다 큰봉이 나오면 cond3은 true
if Cond4 == true and data3(stime <= 120000 and C >= 2.0) Then
cond3 = true;
부분에서
"12시 이전에 종가가 2.0보다 큰봉이 나오면"이 아니라
"12시 이전에 종가가 줄곧 2.0보다 크면"을 의도했던 것입니다.
이에 맞는 수식 부탁드립니다. 감사합니다.
답변 1
예스스탁 예스스탁 답변
2011-06-24 11:03:40
안녕하세요
예스스탁입니다.
수정한 식입니다.
cond4가 true가 된 이후 종가가 2.0미만이 한번이라도
발생하면 cond3이 true가 되도록 변경했습니다.
매수식에서는 cond4가 ture이고 cond3은 false 일대
신호가 발생하라고 작성했습니다.
var : cond3(false,data3),cond4(false,data3);
var : D1H1(0,data1),D1H2(0,data1),D3H1(0,data3),D3H2(0,data3);
#data3의 첫봉에 각변수 false로 초기화
If Data3(sDate!=sDate[1]) Then{
cond3 = False;
cond4 = False;
}
#data1기준 10시 10시30분 고가 저장
if data1(sTime==100000) Then
D1H1=data1(H);
if data1(sTime==103000) Then
D1H2=data1(H);
#data3기준 10시 10시30분 고가 저장
if data3(sTime==100000) Then
D3H1 =data3(H);
if data3(sTime==103000) Then
D3H2 = data3(H);
#data3-10시 30분이후 종가가 10시와 10시 30분 고가보다 큰봉 나오면 cond4은 true
If Data3(c > D3H1 and c > D3H2 and stime>103000) and Cond4 == false Then
Cond4 = true;
# cond4가 ture이고 12시이전에 종가가 2.0보다 큰봉이 나오면 cond3은 true
if Cond4 == true and data3(stime <= 120000 and C < 2.0) Then
cond3 = true;
If MarketPosition == 0 and count<1 and data1(stime>103000 and stime<=120000) Then {
If data1(c>1.5 and c<=2.0 and c>D1H1 and c > D1H2 and c > o) Then {
If c<data2(c) and c<data3(c) and cond4 == true and cond3==false Then
buy("매수",onclose,DEF,2);
}
}
즐거운 하루되세요
> 송사범 님이 쓴 글입니다.
> 제목 : 식 수정부탁..
> 19286질문에 대하여 아래와 같이 답글 잘 보았습니다.
그런데 제가 의도했던 것과 다른 부분이 있어 그 아래 질문 내용에 맞게 수정 부탁드립
니다.
---------------------------------------------------------------------------------
var5와 var6이 특별한 제어가 없어 해당시간이후에
조건만 만족하면 값이 갱신되므로
최초 한번만 저장하도록 하고 수식에 사용되는
내부변수를 각 주기를 쫒아가도록 변경했습니다.
주석을 참고하시기 바랍니다.
var : cond3(false,data3),cond4(false,data3);
var : D1H1(0,data1),D1H2(0,data1),D3H1(0,data3),D3H2(0,data3);
#data3의 첫봉에 각변수 false로 초기화
If Data3(sDate!=sDate[1]) Then{
cond3 = False;
cond4 = False;
}
#data1기준 10시 10시30분 고가 저장
if data1(sTime==100000) Then
D1H1=data1(H);
if data1(sTime==103000) Then
D1H2=data1(H);
#data3기준 10시 10시30분 고가 저장
if data3(sTime==100000) Then
D3H1 =data3(H);
if data3(sTime==103000) Then
D3H2 = data3(H);
#data3-10시 30분이후 종가가 10시와 10시 30분 고가보다 큰봉 나오면 cond4 true
If Data3(c > D3H1 and c > D3H2 and stime>103000) and Cond4 == false Then
Cond4 = true;
# cond4가 ture이고 12시이전에 종가가 2.0보다 큰봉이 나오면 cond3은 true
if Cond4 == true and data3(stime <= 120000 and C >= 2.0) Then
cond3 = true;
If MarketPosition == 0 and count<1 and data1(stime>103000 and stime<=120000) Then {
If data1(c>1.5 and c<=2.0 and c>D1H1 and c > D1H2 and c > o) Then {
If c<data2(c) and c<data3(c) and cond3==true Then #cond3 true일때 다른조건 만족하면 진입
buy("매수",onclose,DEF,2);
}
}
---------------------------------------------------------------------------------
위 식중,
# cond4가 ture이고 12시이전에 종가가 2.0보다 큰봉이 나오면 cond3은 true
if Cond4 == true and data3(stime <= 120000 and C >= 2.0) Then
cond3 = true;
부분에서
"12시 이전에 종가가 2.0보다 큰봉이 나오면"이 아니라
"12시 이전에 종가가 줄곧 2.0보다 크면"을 의도했던 것입니다.
이에 맞는 수식 부탁드립니다. 감사합니다.
다음글
이전글