커뮤니티

1683번 관련 문의드립니다.

프로필 이미지
베드로
2011-01-18 13:16:48
653
글번호 35067
답변완료
안녕하세요. 작성하여주신 청산식을 적용하였더니 매수청산2는 작동을 하지않아 다시한번 문의드립니다. 아래식에 무엇이 잘못되었는지 번거로우시더라도 한번 더 검토하여 수정하여 주시면 고맙겠읍니다 참고로 당일 1 회 매매로서 매수직전이라는 표현은 장시작후 첫매수를 의미합니다. 원식에는 매수매도가 있는 리버셜전략이였는데 옵션매수전용식으로 변경하고자 하니 매도를 매수청산식으로 변경하고자 합니다 원식에 신호발생 순서는 2가지 방식으로 진행됩니다. 1)매수가 먼저 진행될 경우 매수 ---> 매도 ---> 매도청산/매수 ---> 매수청산 2)매도가 먼저 진행될 경우 매도 ---> 매수 ---> 매수청산/매도 ---> 매도청산 여기서 매수가 먼저 발생한 1)번경우 는 exitlong("매수청산2",Atstop,dayHigh- var1*len1); 으로 청산하고, 매도가 먼저발생한 2)번경우는 exitlong("매수청산 1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); 으로 청산 하고자 하는것입니다. ############################################# input : len1(0.35), len(3),n(20); var : CurrentEntryNum(0); Var1=dayhigh(1)-dayLow(1); var2 = countif(H >= dayHigh-var1*len1,dayindex+1); //var2 = countif(H >= dayHigh-var1*len1,BarsSinceExit(1)); condition1= sdate==exitdate(1) And marketposition(1)==1; if date<>date[1] Then { var50 = TotalTrades; } CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 ); //하루에 1번만 진입 If stime<150000 then { If condition1==False And currententrynum-var50<=1 and marketposition <>1 then buy("매수",Atstop,dayLow+var1*len1); } //청산 if MarketPosition == 1 Then{ if var2[BarsSinceEntry] >= 1 Then exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); if var2[BarsSinceEntry] < 1 Then exitlong("매수청산2",Atstop,dayHigh-var1*len1); } ##당일청산(만기일반영) if date == 20100311 || date == 20100610|| date == 20100909 || date == 20101209 then setstopendofday(1440); else setstopendofday(1500); 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-01-18 15:04:18

안녕하세요 예스스탁입니다. #atstop이 값을 지정하면 다음봉의 시세를 판단하므로 #현재저가가 dayHigh[1]-var1*len1이하의 시세를 판단하는것으로 수정했습니다 #또한 두번째 봉부터 조건판단하도록 했습니다. input : len1(0.35), len(3),n(20); var : CurrentEntryNum(0); if date<>date[1] Then { var50 = TotalTrades; Condition11 = False; } if dayindex > 0 and L <= dayHigh[1]-var1*len1 Then Condition11 = true; Var1=dayhigh(1)-dayLow(1); condition1= sdate==exitdate(1) And marketposition(1)==1; CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 ); //하루에 1번만 진입 If stime<150000 then { If condition1==False And currententrynum-var50<=1 and marketposition <>1 then buy("매수",Atstop,dayLow+var1*len1); } //청산 if MarketPosition == 1 Then{ if Condition11[BarsSinceEntry] == true Then exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); if Condition11[BarsSinceEntry] == false then exitlong("매수청산2",Atstop,dayHigh-var1*len1); } ##당일청산(만기일반영) if date == 20100311 || date == 20100610|| date == 20100909 || date == 20101209 then setstopendofday(1440); else setstopendofday(1500); 즐거운 하루되세요 > 베드로 님이 쓴 글입니다. > 제목 : 1683번 관련 문의드립니다. > 안녕하세요. 작성하여주신 청산식을 적용하였더니 매수청산2는 작동을 하지않아 다시한번 문의드립니다. 아래식에 무엇이 잘못되었는지 번거로우시더라도 한번 더 검토하여 수정하여 주시면 고맙겠읍니다 참고로 당일 1 회 매매로서 매수직전이라는 표현은 장시작후 첫매수를 의미합니다. 원식에는 매수매도가 있는 리버셜전략이였는데 옵션매수전용식으로 변경하고자 하니 매도를 매수청산식으로 변경하고자 합니다 원식에 신호발생 순서는 2가지 방식으로 진행됩니다. 1)매수가 먼저 진행될 경우 매수 ---> 매도 ---> 매도청산/매수 ---> 매수청산 2)매도가 먼저 진행될 경우 매도 ---> 매수 ---> 매수청산/매도 ---> 매도청산 여기서 매수가 먼저 발생한 1)번경우 는 exitlong("매수청산2",Atstop,dayHigh- var1*len1); 으로 청산하고, 매도가 먼저발생한 2)번경우는 exitlong("매수청산 1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); 으로 청산 하고자 하는것입니다. ############################################# input : len1(0.35), len(3),n(20); var : CurrentEntryNum(0); Var1=dayhigh(1)-dayLow(1); var2 = countif(H >= dayHigh-var1*len1,dayindex+1); //var2 = countif(H >= dayHigh-var1*len1,BarsSinceExit(1)); condition1= sdate==exitdate(1) And marketposition(1)==1; if date<>date[1] Then { var50 = TotalTrades; } CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 ); //하루에 1번만 진입 If stime<150000 then { If condition1==False And currententrynum-var50<=1 and marketposition <>1 then buy("매수",Atstop,dayLow+var1*len1); } //청산 if MarketPosition == 1 Then{ if var2[BarsSinceEntry] >= 1 Then exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); if var2[BarsSinceEntry] < 1 Then exitlong("매수청산2",Atstop,dayHigh-var1*len1); } ##당일청산(만기일반영) if date == 20100311 || date == 20100610|| date == 20100909 || date == 20101209 then setstopendofday(1440); else setstopendofday(1500); 감사합니다.