커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
8210
글번호 230811
답변완료
문의 드립니다
수고 많으십니다
항상 부탁만드려서 죄송합니다 초보이다보니 . . . .
진입조건이(매수,매도) 만족하고 몇봉뒤에도(몇봉 뒤 인지는 제가 조정 할수있게) 처음 그
조건이 만족하면 신호가 나오게 해주십시요
부탁드립니다
감사합니다
2013-10-29
192
글번호 68967
답변완료
승리거래 횟수의 이동추적에 관하여
#너무 자주 부탁드려서 운영자님과 다른 분들께 정말 죄송합니다.
<요청>
하루에 한번 진입해서 당일청산하는 로직이 있습니다.(진입안할 수도 있는 로직)
이 로직의 최근 10회거래중 이익으로 청산되어진 승리거래의 수를 지표로 나타내는
방법이 무엇인지 지도 부탁드립니다.
예를 들어 오늘 장이 시작하기 전에 최근 10개 거래중 승리거래의 횟수가 3회이면
10이동승리횟수 = 3임을 알 수 있고
어제 장이 시작하기 전의 10이동승리횟수도 알 수 있도록
지표를 짜보았으면 좋겠습니다.
감사합니다.
2013-10-29
204
글번호 68963
답변완료
감사합니다.
먼저 빠른 친철한 답변에 감사드립니다.
아래의 조건을 만족하였을 때 매수신수가 발생하는 수식부탁드립니다.(최근 a, 그이전 b, 그그이전 c이라고 했을 때)
-양봉이 연속하여 3개 이루어짐
-2개(b와 c)의 종가는 20분선아래에 있음
-5분선이 20분선 위에 존재
또한 아래의 조건일 때 진입을 제한하는 수식을 부탁드립니다.
5분봉 기준 최근 5개봉의 저가와 고가의 차이가 20%이상인 경우 진입금지
감사합니다.
2013-10-29
197
글번호 68962
erwe343 님에 의해서 삭제되었습니다.
2013-10-29
2
글번호 68961
답변완료
차트 관련 문의드립니다.
차트에서 캔들을 겹쳐 놓고서 볼 때
여러 개의 캔들의 가격을 동시에 볼 수 있는 방법이 있는지요..
현재는 해당 캔들을 클릭해야 가격이 나타나게 되어 있네요..
어차피 겹쳐 보는 기능이 있게 했다면
각각의 캔들의 가격도 같이 나와야 하는 거 아닌지요..
많이 불편합니다.
아니면 수식을 만들 수 있는지요..
답변부탁드립니다.
수고하세요~
2013-10-29
193
글번호 68958
답변완료
수정부탁합니다 감사합니다
아래 2가지 시스템식을 통합해서 서로 먼저 조건이 되는 쪽으로 매수 매도를 하게 하고 싶은데 수정부탁드립니다
input : 매수진입별횟수(2),매도진입별횟수(2),당일최대매수횟수(5),당일최대매도횟수(5);
var : direction(0),HH(0),LL(0),cnt(0),count(0),기준가(0);
var : Bcond1(false),Bcond2(false),Bcond3(false),Bcond4(false),Bcond5(false);
var : Scond1(false),Scond2(false),Scond3(false),Scond4(false),Scond5(false);
var : Bcnt1(0),Bcnt2(0),Bcnt3(0),Bcnt4(0),Bcnt5(0),Didx(0);
var : Scnt1(0),Scnt2(0),Scnt3(0),Scnt4(0),Scnt5(0),Buycnt(0),Sellcnt(0);
if stime == 180000 or (stime > 180000 and stime[1] < 180000) Then
기준가 = O;
var1 = 기준가-4.0;
var2 = 기준가-2.0;
var3 = 기준가+2.0;
var4 = 기준가+4.0;
if stime == 90000 or (stime > 090000 and stime[1] < 090000) Then{
direction = 0;
Didx = 0;
}
count = 0;
Bcnt1 = 0;Bcnt2 = 0;Bcnt3 = 0;Bcnt4 = 0;
Scnt1 = 0;Scnt2 = 0;Scnt3 = 0;Scnt4 = 0;
Buycnt = 0;
Sellcnt = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) and EntryTime(cnt) >= 090000 and EntryTime(cnt) <= 151500 Then{
count = count+1;
if IsEntryName("b1",cnt) == true Then Bcnt1 = Bcnt1+1;
if IsEntryName("b2",cnt) == true Then Bcnt2 = Bcnt2+1;
if IsEntryName("b3",cnt) == true Then Bcnt3 = Bcnt3+1;
if IsEntryName("b4",cnt) == true Then Bcnt4 = Bcnt4+1;
if IsEntryName("s1",cnt) == true Then Scnt1 = Scnt1+1;
if IsEntryName("s2",cnt) == true Then Scnt2 = Scnt2+1;
if IsEntryName("s3",cnt) == true Then Scnt3 = Scnt3+1;
if IsEntryName("s4",cnt) == true Then Scnt4 = Scnt4+1;
if MarketPosition(cnt) == 1 then
Buycnt = Buycnt+1;
if MarketPosition(cnt) == -1 then
SEllcnt = Sellcnt+1;
}
}
if stime >= 090000 and stime <= 151500 then{
Didx = Didx+1;
if Didx > 1 Then{
if crossup(C,var1) Then {
direction = 1;
HH = H;
}
if crossup(C,var2) Then {
direction = 2;
HH = H;
}
if crossup(C,var3) Then {
direction = 3;
HH = H;
}
if crossup(C,var4) Then {
direction = 4;
HH = H;
}
if CrossDown(C,var1) Then {
direction = -1;
LL = L;
}
if CrossDown(C,var2) Then {
direction = -2;
LL = L;
}
if CrossDown(C,var3) Then{
direction = -3;
LL = L;
}
if CrossDown(C,var4) Then {
direction = -4;
LL = L;
}
}
if H > HH Then HH = H;
if L < LL Then LL = L;
Bcond1 = (count == 0 and countif(direction == 1 and direction[1] != 1,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 1 and direction[1] != 1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 1 and direction[1] != 1,BarsSinceExit(1)) >= 1);
Bcond2 = (count == 0 and countif(direction == 2 and direction[1] != 2,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 2 and direction[1] != 2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 2 and direction[1] != 2,BarsSinceExit(1)) >= 1);
Bcond3 = (count == 0 and countif(direction == 3 and direction[1] != 3,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 3 and direction[1] != 3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 3 and direction[1] != 3,BarsSinceExit(1)) >= 1);
Bcond4 = (count == 0 and countif(direction == 4 and direction[1] != 4,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 4 and direction[1] != 4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 4 and direction[1] != 4,BarsSinceExit(1)) >= 1);
Scond1 = (count == 0 and countif(direction == -1 and direction[1] != -1,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -1 and direction[1] != -1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -1 and direction[1] != -1,BarsSinceExit(1)) >= 1);
Scond2 = (count == 0 and countif(direction == -2 and direction[1] != -2,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -2 and direction[1] != -2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -2 and direction[1] != -2,BarsSinceExit(1)) >= 1);
Scond3 = (count == 0 and countif(direction == -3 and direction[1] != -3,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -3 and direction[1] != -3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -3 and direction[1] != -3,BarsSinceExit(1)) >= 1);
Scond4 = (count == 0 and countif(direction == -4 and direction[1] != -4,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -4 and direction[1] != -4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -4 and direction[1] != -4,BarsSinceExit(1)) >= 1);
if stime > 090000 and stime < 150000 then{
if BuyCnt < 당일최대매수횟수 then{
if direction == 1 and HH >= var1+0.5 and Bcond1 == true and Bcnt1 < 매수진입별횟수 Then buy("b1",AtLimit,HH-0.4);
if direction == 2 and HH >= var2+0.5 and Bcond2 == true and Bcnt2 < 매수진입별횟수 Then buy("b2",AtLimit,HH-0.4);
if direction == 3 and HH >= var3+0.5 and Bcond3 == true and Bcnt3 < 매수진입별횟수 Then buy("b3",AtLimit,HH-0.4);
if direction == 4 and HH >= var4+0.5 and Bcond4 == true and Bcnt4 < 매수진입별횟수 Then buy("b4",AtLimit,HH-0.4);
}
if Sellcnt < 당일최대매도횟수 then{
if direction == -1 and LL <= var1-0.5 and Scond1 == true and Scnt1 < 매도진입별횟수 Then Sell("s1",AtLimit,LL+0.4);
if direction == -2 and LL <= var2-0.5 and Scond2 == true and Scnt2 < 매도진입별횟수 Then Sell("s2",AtLimit,LL+0.4);
if direction == -3 and LL <= var3-0.5 and Scond3 == true and Scnt3 < 매도진입별횟수 Then Sell("s3",AtLimit,LL+0.4);
if direction == -4 and LL <= var4-0.5 and Scond4 == true and Scnt4 < 매도진입별횟수 Then Sell("s4",AtLimit,LL+0.4);
}
}
}
input : 매수진입별횟수(2),매도진입별횟수(2),당일최대매수횟수(5),당일최대매도횟수(5);
var : direction(0),HH(0),LL(0),cnt(0),count(0),기준가(0);
var : Bcond1(false),Bcond2(false),Bcond3(false),Bcond4(false),Bcond5(false);
var : Scond1(false),Scond2(false),Scond3(false),Scond4(false),Scond5(false);
var : Bcnt1(0),Bcnt2(0),Bcnt3(0),Bcnt4(0),Bcnt5(0),Didx(0);
var : Scnt1(0),Scnt2(0),Scnt3(0),Scnt4(0),Scnt5(0),Buycnt(0),Sellcnt(0);
if stime == 90000 or (stime > 090000 and stime[1] < 090000) Then
기준가 = 0;
var1 = 기준가-4.0;
var2 = 기준가-2.0;
var3 = 기준가+2.0;
var4 = 기준가+4.0;
if stime == 90000 or (stime > 090000 and stime[1] < 090000) Then{
direction = 0;
Didx = 0;
}
count = 0;
Bcnt1 = 0;Bcnt2 = 0;Bcnt3 = 0;Bcnt4 = 0;
Scnt1 = 0;Scnt2 = 0;Scnt3 = 0;Scnt4 = 0;
Buycnt = 0;
Sellcnt = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) and EntryTime(cnt) >= 090000 and EntryTime(cnt) <= 151500 Then{
count = count+1;
if IsEntryName("b1",cnt) == true Then Bcnt1 = Bcnt1+1;
if IsEntryName("b2",cnt) == true Then Bcnt2 = Bcnt2+1;
if IsEntryName("b3",cnt) == true Then Bcnt3 = Bcnt3+1;
if IsEntryName("b4",cnt) == true Then Bcnt4 = Bcnt4+1;
if IsEntryName("s1",cnt) == true Then Scnt1 = Scnt1+1;
if IsEntryName("s2",cnt) == true Then Scnt2 = Scnt2+1;
if IsEntryName("s3",cnt) == true Then Scnt3 = Scnt3+1;
if IsEntryName("s4",cnt) == true Then Scnt4 = Scnt4+1;
if MarketPosition(cnt) == 1 then
Buycnt = Buycnt+1;
if MarketPosition(cnt) == -1 then
SEllcnt = Sellcnt+1;
}
}
if stime >= 090000 and stime <= 151500 then{
Didx = Didx+1;
if Didx > 1 Then{
if crossup(C,var1) Then {
direction = 1;
HH = H;
}
if crossup(C,var2) Then {
direction = 2;
HH = H;
}
if crossup(C,var3) Then {
direction = 3;
HH = H;
}
if crossup(C,var4) Then {
direction = 4;
HH = H;
}
if CrossDown(C,var1) Then {
direction = -1;
LL = L;
}
if CrossDown(C,var2) Then {
direction = -2;
LL = L;
}
if CrossDown(C,var3) Then{
direction = -3;
LL = L;
}
if CrossDown(C,var4) Then {
direction = -4;
LL = L;
}
}
if H > HH Then HH = H;
if L < LL Then LL = L;
Bcond1 = (count == 0 and countif(direction == 1 and direction[1] != 1,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 1 and direction[1] != 1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 1 and direction[1] != 1,BarsSinceExit(1)) >= 1);
Bcond2 = (count == 0 and countif(direction == 2 and direction[1] != 2,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 2 and direction[1] != 2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 2 and direction[1] != 2,BarsSinceExit(1)) >= 1);
Bcond3 = (count == 0 and countif(direction == 3 and direction[1] != 3,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 3 and direction[1] != 3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 3 and direction[1] != 3,BarsSinceExit(1)) >= 1);
Bcond4 = (count == 0 and countif(direction == 4 and direction[1] != 4,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 4 and direction[1] != 4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 4 and direction[1] != 4,BarsSinceExit(1)) >= 1);
Scond1 = (count == 0 and countif(direction == -1 and direction[1] != -1,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -1 and direction[1] != -1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -1 and direction[1] != -1,BarsSinceExit(1)) >= 1);
Scond2 = (count == 0 and countif(direction == -2 and direction[1] != -2,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -2 and direction[1] != -2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -2 and direction[1] != -2,BarsSinceExit(1)) >= 1);
Scond3 = (count == 0 and countif(direction == -3 and direction[1] != -3,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -3 and direction[1] != -3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -3 and direction[1] != -3,BarsSinceExit(1)) >= 1);
Scond4 = (count == 0 and countif(direction == -4 and direction[1] != -4,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -4 and direction[1] != -4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -4 and direction[1] != -4,BarsSinceExit(1)) >= 1);
if stime > 090000 and stime < 150000 then{
if BuyCnt < 당일최대매수횟수 then{
if direction == 1 and HH >= var1+0.5 and Bcond1 == true and Bcnt1 < 매수진입별횟수 Then buy("b1",AtLimit,HH-0.4);
if direction == 2 and HH >= var2+0.5 and Bcond2 == true and Bcnt2 < 매수진입별횟수 Then buy("b2",AtLimit,HH-0.4);
if direction == 3 and HH >= var3+0.5 and Bcond3 == true and Bcnt3 < 매수진입별횟수 Then buy("b3",AtLimit,HH-0.4);
if direction == 4 and HH >= var4+0.5 and Bcond4 == true and Bcnt4 < 매수진입별횟수 Then buy("b4",AtLimit,HH-0.4);
}
if Sellcnt < 당일최대매도횟수 then{
if direction == -1 and LL <= var1-0.5 and Scond1 == true and Scnt1 < 매도진입별횟수 Then Sell("s1",AtLimit,LL+0.4);
if direction == -2 and LL <= var2-0.5 and Scond2 == true and Scnt2 < 매도진입별횟수 Then Sell("s2",AtLimit,LL+0.4);
if direction == -3 and LL <= var3-0.5 and Scond3 == true and Scnt3 < 매도진입별횟수 Then Sell("s3",AtLimit,LL+0.4);
if direction == -4 and LL <= var4-0.5 and Scond4 == true and Scnt4 < 매도진입별횟수 Then Sell("s4",AtLimit,LL+0.4);
}
}
}
2013-10-29
206
글번호 68957
답변완료
간단한 수식
9시 첫봉이 기준(전일 종가 기준 아님)이고
현재봉이 전봉의 고가+0.1 이면 1의 값을 갖도록 하는 식은
어떻게 표현하는지요...
2013-10-29
205
글번호 68956
답변완료
스톱공식
당일 시스템에서
0.2%이하 수익일 경우 -0.2%손실이면 손절매
0.2%이상~0.4%이하 수익상황이면 본전올때까지 홀딩
0.4%이상 수익상황이면 0.2%수익올때까지 홀딩
이와 같이 손익의 구간별로 트레일링 스톱 로직을 수식화하려면
어떻게 하나요?
감사합니다.
2013-10-29
208
글번호 68955
답변완료
수식문의
아래의수식에서 전고 전저돌파 붕괴시 텍스트로 표현하고싶은데요 감사합니다
Input:상승률(0.5),하락률(0.5);
Var:j(0),상승(100),하락(-100),양방향(2),색깔(0),파랑(-1),빨강(1),
기준고(0),기준저(0),기준고Bar(0),기준저Bar(0),추세(0),이중파동(0);
var : hbody(0),lbody(0);
Array:고[20](0),저[20](0),고Bar[20](0),저Bar[20](0);
#==========================================#
# 전고점,전저점 index 증가
#==========================================#
For j = 1 To 19
{
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
}
#==========================================#
# 이중파동 처리
#==========================================#
If 이중파동 > 0 Then
{
if 색깔 == 빨강 Then{
Plot1(이중파동,"Zigzag",blue);
var2 = 이중파동;
var3 = -1;
}
Else{
Plot1(이중파동,"Zigzag",red);
var1 = 이중파동;
var3 = 1;
}
이중파동 = 0;
}
#==========================================#
# 최근 고,저 갱신
#==========================================#
If 기준고 <= Hbody || 기준고 == 0 || IsNaN(기준고) == True Then
{
기준고 = Hbody;
기준고Bar = 0;
}
Else
기준고Bar = 기준고Bar + 1;
If 기준저 >= Lbody || 기준저 == 0 || IsNaN(기준저) == True Then
{
기준저 = Lbody;
기준저Bar = 0;
}
Else
기준저Bar = 기준저Bar + 1;
#==========================================#
# 추세방향 결정
#==========================================#
If 기준고 * (1 - (하락률/100)) > Hbody && 기준저 * (1 + (상승률/100)) < Lbody Then
{
추세 = Iff(기준고Bar==기준저Bar,양방향,Iff(기준고Bar>기준저Bar,상승,하락));
}
Else If 기준고 * (1 - (하락률/100)) > Hbody Then 추세 = 하락;
Else If 기준저 * (1 + (상승률/100)) < Lbody Then 추세 = 상승;
#==========================================#
# 추세변화에 따른 변곡점 처리
#==========================================#
If 추세[1] == 상승 && 추세 == 하락 Then
{
For j = 18 DownTo 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
고[1] = 기준고;
고Bar[1] = 기준고Bar;
기준고 = Hbody;
기준고Bar = 0;
기준저 = Lbody;
기준저Bar = 0;
If 고[2] < 고[1] Then 색깔 = 빨강 ;
If 이중파동[1] > 0 Then 이중파동 = 고[1];
Else {
plot1(고[1],"Zigzag",RED);
var1 = 고[1];
var3 = 1;
}
}
If 추세[1] == 하락 && 추세 == 하락 &&
고[1] < 기준고 &&
기준고 * (1 - (하락률/100)) > Hbody Then
{
For j = 18 DownTo 1
{
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
고[1] = 기준고;
고Bar[1] = 기준고Bar;
저[1] = 기준저;
저Bar[1] = 기준저Bar;
기준고 = Hbody;
기준고Bar = 0;
기준저 = Lbody;
기준저Bar = 0;
If 저[2] > 저[1] Then 색깔 = 파랑;
plot1(저[1],"Zigzag",blue);
var2 = 저[1];
var3 = -1;
If 고[2] < 고[1] Then 색깔 = 빨강;
이중파동 = 고[1];
}
If 추세[1] == 하락 && 추세 == 상승 Then
{
For j = 18 DownTo 1
{
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
저[1] = 기준저;
저Bar[1] = 기준저Bar;
기준저 = Lbody;
기준저Bar = 0;
기준고 = Hbody;
기준고Bar = 0;
If 저[2] > 저[1] Then 색깔 = 파랑;
If 이중파동[1] > 0 Then 이중파동 = 저[1];
Else {
plot1(저[1],"Zigzag",blue);
var2 = 저[1];
var3 = -1;
}
}
If 추세[1] == 상승 && 추세 == 상승 &&
저[1] > 기준저 &&
기준저 * (1 + (상승률/100)) < Lbody Then
{
For j = 18 DownTo 1
{
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
고[1] = 기준고;
고Bar[1] = 기준고Bar;
저[1] = 기준저;
저Bar[1] = 기준저Bar;
기준저 = Lbody;
기준저Bar = 0;
기준고 = Hbody;
기준고Bar = 0;
If 고[2] < 고[1] Then 색깔 = 빨강;
plot1(고[1],"Zigzag",RED);
var1 = 고[1];
var3 = 1;
If 저[2] > 저[1] Then 색깔 = 파랑;
이중파동 = 저[1];
}
If 추세 == 양방향 Then
{
For j = 18 DownTo 1
{
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
고[1] = 기준고;
고Bar[1] = 기준고Bar;
저[1] = 기준저;
저Bar[1] = 기준저Bar;
기준고 = Hbody;
기준고Bar = 0;
기준저 = Lbody;
기준저Bar = 0;
추세 = 추세[1];
If 추세[1] == 상승 Then
{
If 고[2] < 고[1] Then 색깔 = 빨강;
Plot1(고[1],"Zigzag",RED);
var1 = 고[1];
var3 = 1;
If 저[2] > 저[1] Then 색깔 = 파랑;
이중파동 = 저[1];
}
Else
{
If 저[2] > 저[1] Then 색깔 = 파랑;
Plot1(저[1],"Zigzag",blue);
Text_New(sdate,stime,저[1],NumToStr(저[1],2));
var2 = 저[1];
var3 = -1;
If 고[2] < 고[1] Then 색깔 = 빨강;
이중파동 = 고[1];
}
}
if var3 == -1 Then{
plot2(var2);
}
if var3 == 1 Then{
plot2(var1);
}
2013-10-29
219
글번호 68954