커뮤니티

시스템수정요청

프로필 이미지
조민철
2014-11-12 12:54:28
137
글번호 80313
답변완료
항상 감사드립니다 1. 아래 시스템식은 청산후(eB,eS) 동일방향으로 재진입금지 시스템입니다 그런데 마지막 청산이 최종거래인 당일매수/매도청산이 발생하지 않으면 다음날 첫신호가 전날 마지막발생신호가 동일할때 발생하지않습니다 당일 첫신호 발생시 전날발생신호와 상관없이 발생될수 있도록 수정부탁드립니다 ################################################## ##### 당일 09:00 장시작 / 14:50:00 장종료 ##### ################################################## input : 시작시간(090000),끝시간(145000); var : Start(false),entrycnt(0),Bcond(false),Scond(false),idx(0); if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{ Start = True; entrycnt = entrycnt+1; Idx = 0; } Idx = idx+1; if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then Start = false; Bcond = var11==1 and c>var78 and c>Hma1 ; Scond = var11==-1 and c<var78 and c<Lma1 ; Condition1 = ExitDate(1) == true and MarketPosition(1) == 1 and (IsExitName("eB",1) == true or IsExitName("StopLoss",1) == true); Condition2 = ExitDate(1) == true and MarketPosition(1) == -1 and (IsExitName("eS",1) == true or IsExitName("StopLoss",1) == true); if Idx >= 1 and Start == true and Bcond == true and (MarketPosition == -1 or (MarketPosition == 0 and Condition1 == False )) Then buy("B1"); if Idx >= 1 and Start == true and Scond == true and (MarketPosition == 1 or (MarketPosition == 0 and Condition2 == False )) Then sell("S1"); ########################## ##### 매수/매도 청산 ##### ########################## if MarketPosition == 1 and c<Lma1 and c<var48 Then exitlong("eB"); if MarketPosition == -1 and c>Hma1 and c>var48 Then ExitShort("eS"); if stime == 145000 or (stime > 145000 and stime[1] < 145000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } 2.선행스팬 2(48) ########################## ### 선행스팬2(48) 기준 ### ########################## var48 = (Highest(High, 48) + Lowest(Low, 48)) / 2; 위식에서 var48[25] 와 var48 의 차이를 알고싶습니다 var48[25]를 사용시에는 챠트에서 수평으로 25이동해서 작성하는데 var48 을 단순하게 앞으로 25이동한것처럼 챠트가 동일하지가 않습니다 감사합니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-11-12 13:40:37

안녕하세요 예스스탁입니다. 1. input : 시작시간(090000),끝시간(145000); var : Start(false),entrycnt(0),Bcond(false),Scond(false),idx(0); if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{ Start = True; entrycnt = entrycnt+1; Idx = 0; } Idx = idx+1; if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then Start = false; Bcond = var11==1 and c>var78 and c>Hma1 ; Scond = var11==-1 and c<var78 and c<Lma1 ; Condition1 = ExitDate(1) == sdate and MarketPosition(1) == 1 and (IsExitName("eB",1) == true or IsExitName("StopLoss",1) == true); Condition2 = ExitDate(1) == sdate and MarketPosition(1) == -1 and (IsExitName("eS",1) == true or IsExitName("StopLoss",1) == true); if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then Entrycnt = Entrycnt+1; if Idx >= 1 and Start == true and Bcond == true and (EntryCnt == 0 or MarketPosition == -1 or (EntryCnt > 0 and MarketPosition == 0 and Condition1 == False )) Then buy("B1"); if Idx >= 1 and Start == true and Scond == true and (EntryCnt == 0 or MarketPosition == 1 or (EntryCnt > 0 and MarketPosition == 0 and Condition2 == False )) Then sell("S1"); ########################## ##### 매수/매도 청산 ##### ########################## if MarketPosition == 1 and c<Lma1 and c<var48 Then exitlong("eB"); if MarketPosition == -1 and c>Hma1 and c>var48 Then ExitShort("eS"); if stime == 145000 or (stime > 145000 and stime[1] < 145000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } 2. var48은 현재봉 값이고 var48[25]는 25개봉 전의 값입니다. 아래와 같이 작성한 것과 같습니다. (Highest(High, 48)[25] + Lowest(Low, 48)[25]) / 2; 첨부된 차트그림에서 #과 ##은 모두 아래지표를 적용한 화면입니다. var48 = (Highest(High, 48) + Lowest(Low, 48)) / 2; plot1(var48); plot2(var48[25]); ##은 2개 모두 수평이동 하지 않은 지표입니다. #은 plot1만 속성에서 수평이동을 25 한것이고 #보시면 plot1과 plot2가 동일한 값인것을 보실수 있습니다. 즐거운 하루되세요 > 조민철 님이 쓴 글입니다. > 제목 : 시스템수정요청 > 항상 감사드립니다 1. 아래 시스템식은 청산후(eB,eS) 동일방향으로 재진입금지 시스템입니다 그런데 마지막 청산이 최종거래인 당일매수/매도청산이 발생하지 않으면 다음날 첫신호가 전날 마지막발생신호가 동일할때 발생하지않습니다 당일 첫신호 발생시 전날발생신호와 상관없이 발생될수 있도록 수정부탁드립니다 ################################################## ##### 당일 09:00 장시작 / 14:50:00 장종료 ##### ################################################## input : 시작시간(090000),끝시간(145000); var : Start(false),entrycnt(0),Bcond(false),Scond(false),idx(0); if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{ Start = True; entrycnt = entrycnt+1; Idx = 0; } Idx = idx+1; if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then Start = false; Bcond = var11==1 and c>var78 and c>Hma1 ; Scond = var11==-1 and c<var78 and c<Lma1 ; Condition1 = ExitDate(1) == true and MarketPosition(1) == 1 and (IsExitName("eB",1) == true or IsExitName("StopLoss",1) == true); Condition2 = ExitDate(1) == true and MarketPosition(1) == -1 and (IsExitName("eS",1) == true or IsExitName("StopLoss",1) == true); if Idx >= 1 and Start == true and Bcond == true and (MarketPosition == -1 or (MarketPosition == 0 and Condition1 == False )) Then buy("B1"); if Idx >= 1 and Start == true and Scond == true and (MarketPosition == 1 or (MarketPosition == 0 and Condition2 == False )) Then sell("S1"); ########################## ##### 매수/매도 청산 ##### ########################## if MarketPosition == 1 and c<Lma1 and c<var48 Then exitlong("eB"); if MarketPosition == -1 and c>Hma1 and c>var48 Then ExitShort("eS"); if stime == 145000 or (stime > 145000 and stime[1] < 145000) Then{ exitlong("당일매수청산"); ExitShort("당일매도청산"); } 2.선행스팬 2(48) ########################## ### 선행스팬2(48) 기준 ### ########################## var48 = (Highest(High, 48) + Lowest(Low, 48)) / 2; 위식에서 var48[25] 와 var48 의 차이를 알고싶습니다 var48[25]를 사용시에는 챠트에서 수평으로 25이동해서 작성하는데 var48 을 단순하게 앞으로 25이동한것처럼 챠트가 동일하지가 않습니다 감사합니다