커뮤니티

문의드립니다

프로필 이미지
베드로
2015-07-15 12:06:35
110
글번호 88462
답변완료
안녕하세요. 43047번 관련 문의드립다. 재진입과 관련하여 설명이 누락되어 오류가 발생된것 같읍니다 재진입조건 = 당일 매수1로 진입하여, 청산한적이 있으면 , 매수2(당일최고점돌파) 진입하라.=====>매도는 반대 -> 매수1 이 발생하지않으면 재매수2 가 발생되어서는 안됨. 오류사항 ======== 매수2는 전일 마지막청산이 매수청산이면 당일 장시작시 매수2가작동됩니다.(매도2 동일사항) 즉. 전일 마지막청산이 매수인가 매도인가에따라 당일 장시작시 영향을 받는것 같읍니다 감사합니다. ============================================================================== input : len(0.25), len1(2.7),n(20),매수진입횟수(1),매도진입횟수(1),매수재진입횟수(1),매도재진입횟수(1); var: cnt(0),Bentry(0),Sentry(0),reBentry(0),reSentry(0); Array : OO[10](0),HH[10](0),LL[10](0); if Bdate != Bdate[1] Then{ OO[0] = O; HH[0] = H; LL[0] = L; for cnt = 1 to 9{ OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if H > HH[0] then HH[0] = H; if L < LL[0] then LL[0] = L; var1 = HH[1]-LL[1]; if bdate <> bdate[1] Then { Bentry = 0; Sentry = 0; reBentry = 0; reSentry = 0; } if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수1") == true Then Bentry = Bentry+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도1") == true Then Sentry = Sentry+1; if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수2") == true Then reBentry = reBentry+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도2") == true Then reSentry = reSentry+1; if stime >= 170000 or stime < 160000 then { if Bentry < 매수진입횟수 and MarketPosition <> 1 Then buy("매수1", atstop, OO[0]+var1*len); if Sentry < 매도진입횟수 and MarketPosition <> -1 Then sell("매도1", atstop, OO[0]-var1*len); if MarketPosition == 0 and MarketPosition(1) == 1 and reBentry < 매수재진입횟수 Then buy("매수2", atstop, HH[0]+PriceScale); if MarketPosition == 0 and MarketPosition(1) == -1 and reSentry < 매도재진입횟수 Then sell("매도2", atstop, LL[0]-PriceScale); } //청산 If marketposition == 1 Then { exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(n)*len1); } if MarketPosition == -1 then{ exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(n)*len1); } if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong(); ExitShort(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-07-15 12:38:01

안녕하세요 예스스탁입니다. 전일 마지막 거래는 인지하지 않게 수정했습니다. 당일 매수1이 한번이상 발생한후 매수2가 발생사고 당일 매도1이 한번이상 발생한후 매도2가 발생합니다. input : len(0.25), len1(2.7),n(20),매수진입횟수(1),매도진입횟수(1),매수재진입횟수(1),매도재진입횟수(1); var: cnt(0),Bentry(0),Sentry(0),reBentry(0),reSentry(0); Array : OO[10](0),HH[10](0),LL[10](0); if Bdate != Bdate[1] Then{ OO[0] = O; HH[0] = H; LL[0] = L; for cnt = 1 to 9{ OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if H > HH[0] then HH[0] = H; if L < LL[0] then LL[0] = L; var1 = HH[1]-LL[1]; if bdate <> bdate[1] Then { Bentry = 0; Sentry = 0; reBentry = 0; reSentry = 0; } if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수1") == true Then Bentry = Bentry+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도1") == true Then Sentry = Sentry+1; if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수2") == true Then reBentry = reBentry+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도2") == true Then reSentry = reSentry+1; if stime >= 170000 or stime < 160000 then { if Bentry < 매수진입횟수 and MarketPosition <> 1 Then buy("매수1", atstop, OO[0]+var1*len); if Sentry < 매도진입횟수 and MarketPosition <> -1 Then sell("매도1", atstop, OO[0]-var1*len); if MarketPosition == 0 and MarketPosition(1) == 1 and Bentry >= 1 and reBentry < 매수재진입횟수 Then buy("매수2", atstop, HH[0]+PriceScale); if MarketPosition == 0 and MarketPosition(1) == -1 and Sentry >= 1 and reSentry < 매도재진입횟수 Then sell("매도2", atstop, LL[0]-PriceScale); } //청산 If marketposition == 1 Then { exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(n)*len1); } if MarketPosition == -1 then{ exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(n)*len1); } if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong(); ExitShort(); } 즐거운 하루되세요 > 베드로 님이 쓴 글입니다. > 제목 : 문의드립니다 > 안녕하세요. 43047번 관련 문의드립다. 재진입과 관련하여 설명이 누락되어 오류가 발생된것 같읍니다 재진입조건 = 당일 매수1로 진입하여, 청산한적이 있으면 , 매수2(당일최고점돌파) 진입하라.=====>매도는 반대 -> 매수1 이 발생하지않으면 재매수2 가 발생되어서는 안됨. 오류사항 ======== 매수2는 전일 마지막청산이 매수청산이면 당일 장시작시 매수2가작동됩니다.(매도2 동일사항) 즉. 전일 마지막청산이 매수인가 매도인가에따라 당일 장시작시 영향을 받는것 같읍니다 감사합니다. ============================================================================== input : len(0.25), len1(2.7),n(20),매수진입횟수(1),매도진입횟수(1),매수재진입횟수(1),매도재진입횟수(1); var: cnt(0),Bentry(0),Sentry(0),reBentry(0),reSentry(0); Array : OO[10](0),HH[10](0),LL[10](0); if Bdate != Bdate[1] Then{ OO[0] = O; HH[0] = H; LL[0] = L; for cnt = 1 to 9{ OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if H > HH[0] then HH[0] = H; if L < LL[0] then LL[0] = L; var1 = HH[1]-LL[1]; if bdate <> bdate[1] Then { Bentry = 0; Sentry = 0; reBentry = 0; reSentry = 0; } if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수1") == true Then Bentry = Bentry+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도1") == true Then Sentry = Sentry+1; if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("매수2") == true Then reBentry = reBentry+1; if MarketPosition == -1 and MarketPosition != MarketPosition[1] and IsEntryName("매도2") == true Then reSentry = reSentry+1; if stime >= 170000 or stime < 160000 then { if Bentry < 매수진입횟수 and MarketPosition <> 1 Then buy("매수1", atstop, OO[0]+var1*len); if Sentry < 매도진입횟수 and MarketPosition <> -1 Then sell("매도1", atstop, OO[0]-var1*len); if MarketPosition == 0 and MarketPosition(1) == 1 and reBentry < 매수재진입횟수 Then buy("매수2", atstop, HH[0]+PriceScale); if MarketPosition == 0 and MarketPosition(1) == -1 and reSentry < 매도재진입횟수 Then sell("매도2", atstop, LL[0]-PriceScale); } //청산 If marketposition == 1 Then { exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(n)*len1); } if MarketPosition == -1 then{ exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(n)*len1); } if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong(); ExitShort(); }