커뮤니티

시스템식 해석 좀 부탁드립니다.

프로필 이미지
풍운
2011-06-08 10:01:29
718
글번호 39517
답변완료
하이투자증권 시스템 교육가서 교재에 나온 "변동성 채널돌파" 예제 입니다. 1. 해석 좀 부탁드립니다. Input:value(2.7),p1(36),p2(28),p3(5),stopPer(1);######2004폐기 Var: chUp(0), chDn(0),slowK(0),slowD(0), Bap(0); setstoploss(StopPer); chUp=dayOpen()+(DayHigh(1)-DayLow(1))/Value; chDn=dayOpen()-(DayHigh(1)-DayLow(1))/Value; slowK=StochasticsK(p1,p2); slowD=StochasticsD(p1,p2,p3); bap=(daylow()+dayhigh())/2; if CrossUp(slowK,slowD)then {var1=C;var5=1;} if CrossDown(slowK,slowD)then {var2=C;var6=1;} #buy/Sell if dayindex()==0 then {if H >=chUP Then Buy(); if L <=ChDn then sell(); var5=0; var6=0;} if C > (chUP+ChDn)/2 and accumN(iff(H>=ChUP,1,0),dayindex()+1)==0 and stime<143000 then buy ("Buy",AtStop,ChUP); if C < (chUP+ChDn)/2 and accumN(iff(L<=ChUP,1,0),dayindex()+1)==0 && stime<143000 then buy ("Sell",AtStop,ChDn); #ExitLong if slowK<slowD and stime>=100000 and var6==1 then exitlong("EL1",AtStop,var2-0.01); if stime<= 100000 and MarketPosition(0)==1 Then ExitLong("El2",atstop,L[dayindex()]); if stime<= 100000 and MarketPosition(0)==1 Then {ExitLong("El3",atstop,(dayopen()+(Chup))/2);exitlong("El4",AtStop,bap);} if stime==145000 then ExitLong("El5"); //ExitShort if slowK<slowD and stime>=100000 and var5==1 Then ExitShort("ES1", AtStop,var1+0.01); if stime <= 100000 and MarketPosition(0)==-1 then ExitShort("ES2", AtStop,H[dayindex()]); if stime >= 100000 and MarketPosition(0)==-1 Then {exitshort("ES3",AtStop,(DayOpen()+(ChDn))/2); ExitShort("ES4", AtStop,baP);} if stime==145000 then ExitShort("ES5"); //만기일 청산 if (date==20050310 || date==20050609 || date==20050908 || date==20051208 || date==20060309 || date==20060608 || date==20060914 || date==20061214 || date==20070308 || date==20070614 || date==20070913 || date==20071213 || date==20080313 || date==20080612 || date==20080911 || date==20081211 || date==20090312 || date==20090611 || date==20090910 || date==20091210 || date==20091210 || date==20100311 || date==20100610 || date==20100610 || date==20100909 || date==20101209 || date==20110310 || date==20110609) then setstopendofday(1449); Else SetStopEndofday(1504); 2. 위 식을 지표로도 변환 좀 부탁드리겠습니다. 늘 감사합니다.
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2011-06-08 13:54:24

안녕하세요 예스스탁입니다. Input:value(2.7),p1(36),p2(28),p3(5),stopPer(1);######2004폐기 Var: chUp(0), chDn(0),slowK(0),slowD(0), Bap(0); setstoploss(StopPer); chUp=dayOpen()+(DayHigh(1)-DayLow(1))/Value; chDn=dayOpen()-(DayHigh(1)-DayLow(1))/Value; slowK=StochasticsK(p1,p2); slowD=StochasticsD(p1,p2,p3); bap=(daylow()+dayhigh())/2; #스토케스틱 k가 D를 상향하면 var1에 종가와 var5에 1저장 if CrossUp(slowK,slowD)then {var1=C;var5=1;} #스토케스틱 k가 D를 하향하면 var2에 종가와 var6에 1저장 if CrossDown(slowK,slowD)then {var2=C;var6=1;} #buy/Sell if dayindex()==0 then { #첫봉에서 if H >=chUP Then Buy(); #고가가 상단값보다 크면 매수 if L <=ChDn then sell();#저가가 하단값보다 작으면 매도 var5=0; #var5를 0값으로 초기화 var6=0; #var5를 0값으로 초기화 } #종가가 상단과 하단의 중간값보다 크고 고가가 상단보다 큰적이 당일 없고 14시 30분 전이면 상단이상의 시세가 나오면 매수 if C > (chUP+ChDn)/2 and accumN(iff(H>=ChUP,1,0),dayindex()+1)==0 and stime<143000 then buy ("Buy",AtStop,ChUP); #종가가 상단과 하단의 중간값보다 작고 저가가 하단보다 작은적이 당일 없고 14시 30분 전이면 하단이하의 시세가 나오면 매도 if C < (chUP+ChDn)/2 and accumN(iff(L<=ChUP,1,0),dayindex()+1)==0 && stime<143000 then buy ("Sell",AtStop,ChDn); #ExitLong # 당일 스토케스틱K가 D를 하향이탈이 일어났고 데드가 유지중일때 10시이후에 데드시 종가-0.01보다 작은 시세 발생하면 청산 if slowK<slowD and stime>=100000 and var6==1 then exitlong("EL1",AtStop,var2-0.01); # 매수포지션이고 10시 이전일경우 매수봉의 저가를 하향하면 청산 if stime<= 100000 and MarketPosition(0)==1 Then ExitLong("El2",atstop,L[dayindex()]); # 매수포지션이고 10시 이전일 경우 시초가와 상단선의 중간값 이하나 당일 중심값이하의 시세가 발생하면 청산 if stime<= 100000 and MarketPosition(0)==1 Then {ExitLong("El3",atstop,(dayopen()+(Chup))/2);exitlong("El4",AtStop,bap);} #14시 50분봉에 청산 if stime==145000 then ExitLong("El5"); //ExitShort # 당일 스토케스틱K가 D를 상향돌파가 일어났고 골드가 유지중일때 10시이후에 골드시 종가+0.01보다 큰 시세 발생하면 청산 if slowK>slowD and stime>=100000 and var5==1 Then ExitShort("ES1", AtStop,var1+0.01); # 매도포지션이고 10시 이전일경우 매도봉의 고가를 상향하면 청산 if stime <= 100000 and MarketPosition(0)==-1 then ExitShort("ES2", AtStop,H[dayindex()]); # 매도포지션이고 10시 이전일 경우 시초가와 상단선의 중간값 이상이나 당일 중심값이상의 시세가 발생하면 청산 if stime >= 100000 and MarketPosition(0)==-1 Then {exitshort("ES3",AtStop,(DayOpen()+(ChDn))/2);ExitShort("ES4", AtStop,baP);} #14시 50분봉에 청산 if stime==145000 then ExitShort("ES5"); //만기일은 14시 49분 청산(만기일 날짜를 직접 지정), 만기일이 아니면 15시 4분 if (date==20050310 || date==20050609 || date==20050908 || date==20051208 || date==20060309 || date==20060608 || date==20060914 || date==20061214 || date==20070308 || date==20070614 || date==20070913 || date==20071213 || date==20080313 || date==20080612 || date==20080911 || date==20081211 || date==20090312 || date==20090611 || date==20090910 || date==20091210 || date==20091210 || date==20100311 || date==20100610 || date==20100610 || date==20100909 || date==20101209 || date==20110310 || date==20110609) then setstopendofday(1449); Else SetStopEndofday(1504); 즐거운 하루되세요 > 풍운 님이 쓴 글입니다. > 제목 : 시스템식 해석 좀 부탁드립니다. > 하이투자증권 시스템 교육가서 교재에 나온 "변동성 채널돌파" 예제 입니다. 1. 해석 좀 부탁드립니다. Input:value(2.7),p1(36),p2(28),p3(5),stopPer(1);######2004폐기 Var: chUp(0), chDn(0),slowK(0),slowD(0), Bap(0); setstoploss(StopPer); chUp=dayOpen()+(DayHigh(1)-DayLow(1))/Value; chDn=dayOpen()-(DayHigh(1)-DayLow(1))/Value; slowK=StochasticsK(p1,p2); slowD=StochasticsD(p1,p2,p3); bap=(daylow()+dayhigh())/2; if CrossUp(slowK,slowD)then {var1=C;var5=1;} if CrossDown(slowK,slowD)then {var2=C;var6=1;} #buy/Sell if dayindex()==0 then {if H >=chUP Then Buy(); if L <=ChDn then sell(); var5=0; var6=0;} if C > (chUP+ChDn)/2 and accumN(iff(H>=ChUP,1,0),dayindex()+1)==0 and stime<143000 then buy ("Buy",AtStop,ChUP); if C < (chUP+ChDn)/2 and accumN(iff(L<=ChUP,1,0),dayindex()+1)==0 && stime<143000 then buy ("Sell",AtStop,ChDn); #ExitLong if slowK<slowD and stime>=100000 and var6==1 then exitlong("EL1",AtStop,var2-0.01); if stime<= 100000 and MarketPosition(0)==1 Then ExitLong("El2",atstop,L[dayindex()]); if stime<= 100000 and MarketPosition(0)==1 Then {ExitLong("El3",atstop,(dayopen()+(Chup))/2);exitlong("El4",AtStop,bap);} if stime==145000 then ExitLong("El5"); //ExitShort if slowK<slowD and stime>=100000 and var5==1 Then ExitShort("ES1", AtStop,var1+0.01); if stime <= 100000 and MarketPosition(0)==-1 then ExitShort("ES2", AtStop,H[dayindex()]); if stime >= 100000 and MarketPosition(0)==-1 Then {exitshort("ES3",AtStop,(DayOpen()+(ChDn))/2); ExitShort("ES4", AtStop,baP);} if stime==145000 then ExitShort("ES5"); //만기일 청산 if (date==20050310 || date==20050609 || date==20050908 || date==20051208 || date==20060309 || date==20060608 || date==20060914 || date==20061214 || date==20070308 || date==20070614 || date==20070913 || date==20071213 || date==20080313 || date==20080612 || date==20080911 || date==20081211 || date==20090312 || date==20090611 || date==20090910 || date==20091210 || date==20091210 || date==20100311 || date==20100610 || date==20100610 || date==20100909 || date==20101209 || date==20110310 || date==20110609) then setstopendofday(1449); Else SetStopEndofday(1504); 2. 위 식을 지표로도 변환 좀 부탁드리겠습니다. 늘 감사합니다.
프로필 이미지

풍운

2011-06-08 18:27:14

위 식을 지표로도 변환 좀 부탁드리겠습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템식 해석 좀 부탁드립니다. > 안녕하세요 예스스탁입니다. Input:value(2.7),p1(36),p2(28),p3(5),stopPer(1);######2004폐기 Var: chUp(0), chDn(0),slowK(0),slowD(0), Bap(0); setstoploss(StopPer); chUp=dayOpen()+(DayHigh(1)-DayLow(1))/Value; chDn=dayOpen()-(DayHigh(1)-DayLow(1))/Value; slowK=StochasticsK(p1,p2); slowD=StochasticsD(p1,p2,p3); bap=(daylow()+dayhigh())/2; #스토케스틱 k가 D를 상향하면 var1에 종가와 var5에 1저장 if CrossUp(slowK,slowD)then {var1=C;var5=1;} #스토케스틱 k가 D를 하향하면 var2에 종가와 var6에 1저장 if CrossDown(slowK,slowD)then {var2=C;var6=1;} #buy/Sell if dayindex()==0 then { #첫봉에서 if H >=chUP Then Buy(); #고가가 상단값보다 크면 매수 if L <=ChDn then sell();#저가가 하단값보다 작으면 매도 var5=0; #var5를 0값으로 초기화 var6=0; #var5를 0값으로 초기화 } #종가가 상단과 하단의 중간값보다 크고 고가가 상단보다 큰적이 당일 없고 14시 30분 전이면 상단이상의 시세가 나오면 매수 if C > (chUP+ChDn)/2 and accumN(iff(H>=ChUP,1,0),dayindex()+1)==0 and stime<143000 then buy ("Buy",AtStop,ChUP); #종가가 상단과 하단의 중간값보다 작고 저가가 하단보다 작은적이 당일 없고 14시 30분 전이면 하단이하의 시세가 나오면 매도 if C < (chUP+ChDn)/2 and accumN(iff(L<=ChUP,1,0),dayindex()+1)==0 && stime<143000 then buy ("Sell",AtStop,ChDn); #ExitLong # 당일 스토케스틱K가 D를 하향이탈이 일어났고 데드가 유지중일때 10시이후에 데드시 종가-0.01보다 작은 시세 발생하면 청산 if slowK<slowD and stime>=100000 and var6==1 then exitlong("EL1",AtStop,var2-0.01); # 매수포지션이고 10시 이전일경우 매수봉의 저가를 하향하면 청산 if stime<= 100000 and MarketPosition(0)==1 Then ExitLong("El2",atstop,L[dayindex()]); # 매수포지션이고 10시 이전일 경우 시초가와 상단선의 중간값 이하나 당일 중심값이하의 시세가 발생하면 청산 if stime<= 100000 and MarketPosition(0)==1 Then {ExitLong("El3",atstop,(dayopen()+(Chup))/2);exitlong("El4",AtStop,bap);} #14시 50분봉에 청산 if stime==145000 then ExitLong("El5"); //ExitShort # 당일 스토케스틱K가 D를 상향돌파가 일어났고 골드가 유지중일때 10시이후에 골드시 종가+0.01보다 큰 시세 발생하면 청산 if slowK>slowD and stime>=100000 and var5==1 Then ExitShort("ES1", AtStop,var1+0.01); # 매도포지션이고 10시 이전일경우 매도봉의 고가를 상향하면 청산 if stime <= 100000 and MarketPosition(0)==-1 then ExitShort("ES2", AtStop,H[dayindex()]); # 매도포지션이고 10시 이전일 경우 시초가와 상단선의 중간값 이상이나 당일 중심값이상의 시세가 발생하면 청산 if stime >= 100000 and MarketPosition(0)==-1 Then {exitshort("ES3",AtStop,(DayOpen()+(ChDn))/2);ExitShort("ES4", AtStop,baP);} #14시 50분봉에 청산 if stime==145000 then ExitShort("ES5"); //만기일은 14시 49분 청산(만기일 날짜를 직접 지정), 만기일이 아니면 15시 4분 if (date==20050310 || date==20050609 || date==20050908 || date==20051208 || date==20060309 || date==20060608 || date==20060914 || date==20061214 || date==20070308 || date==20070614 || date==20070913 || date==20071213 || date==20080313 || date==20080612 || date==20080911 || date==20081211 || date==20090312 || date==20090611 || date==20090910 || date==20091210 || date==20091210 || date==20100311 || date==20100610 || date==20100610 || date==20100909 || date==20101209 || date==20110310 || date==20110609) then setstopendofday(1449); Else SetStopEndofday(1504); 즐거운 하루되세요 > 풍운 님이 쓴 글입니다. > 제목 : 시스템식 해석 좀 부탁드립니다. > 하이투자증권 시스템 교육가서 교재에 나온 "변동성 채널돌파" 예제 입니다. 1. 해석 좀 부탁드립니다. Input:value(2.7),p1(36),p2(28),p3(5),stopPer(1);######2004폐기 Var: chUp(0), chDn(0),slowK(0),slowD(0), Bap(0); setstoploss(StopPer); chUp=dayOpen()+(DayHigh(1)-DayLow(1))/Value; chDn=dayOpen()-(DayHigh(1)-DayLow(1))/Value; slowK=StochasticsK(p1,p2); slowD=StochasticsD(p1,p2,p3); bap=(daylow()+dayhigh())/2; if CrossUp(slowK,slowD)then {var1=C;var5=1;} if CrossDown(slowK,slowD)then {var2=C;var6=1;} #buy/Sell if dayindex()==0 then {if H >=chUP Then Buy(); if L <=ChDn then sell(); var5=0; var6=0;} if C > (chUP+ChDn)/2 and accumN(iff(H>=ChUP,1,0),dayindex()+1)==0 and stime<143000 then buy ("Buy",AtStop,ChUP); if C < (chUP+ChDn)/2 and accumN(iff(L<=ChUP,1,0),dayindex()+1)==0 && stime<143000 then buy ("Sell",AtStop,ChDn); #ExitLong if slowK<slowD and stime>=100000 and var6==1 then exitlong("EL1",AtStop,var2-0.01); if stime<= 100000 and MarketPosition(0)==1 Then ExitLong("El2",atstop,L[dayindex()]); if stime<= 100000 and MarketPosition(0)==1 Then {ExitLong("El3",atstop,(dayopen()+(Chup))/2);exitlong("El4",AtStop,bap);} if stime==145000 then ExitLong("El5"); //ExitShort if slowK<slowD and stime>=100000 and var5==1 Then ExitShort("ES1", AtStop,var1+0.01); if stime <= 100000 and MarketPosition(0)==-1 then ExitShort("ES2", AtStop,H[dayindex()]); if stime >= 100000 and MarketPosition(0)==-1 Then {exitshort("ES3",AtStop,(DayOpen()+(ChDn))/2); ExitShort("ES4", AtStop,baP);} if stime==145000 then ExitShort("ES5"); //만기일 청산 if (date==20050310 || date==20050609 || date==20050908 || date==20051208 || date==20060309 || date==20060608 || date==20060914 || date==20061214 || date==20070308 || date==20070614 || date==20070913 || date==20071213 || date==20080313 || date==20080612 || date==20080911 || date==20081211 || date==20090312 || date==20090611 || date==20090910 || date==20091210 || date==20091210 || date==20100311 || date==20100610 || date==20100610 || date==20100909 || date==20101209 || date==20110310 || date==20110609) then setstopendofday(1449); Else SetStopEndofday(1504); 2. 위 식을 지표로도 변환 좀 부탁드리겠습니다. 늘 감사합니다.
프로필 이미지

풍운

2011-06-09 11:28:40

풍운 님에 의해 삭제된 답변입니다.