커뮤니티

문의드립니다.

프로필 이미지
베드로
2015-08-19 10:07:44
169
글번호 89628
답변완료
안녕하세요. 해선 Crude oil종목에 적용 하여보니 아래식에서 2가지문제가 발생 합니다 수정 부탁드립니다. 수정사항 1.crossup or crossdown 발생시 진입과 청산이 한번만 발생되어야 하나 익절과 손절폭이 좁아 한봉에서 진입과 청산이 발생되면 또다시 신호가 발생됩니다.(진입후 2봉이내 청산발생시 동일 현상) 진입제어 추가하여주세요 2. if stime == 160000 or (stime > 160000 and stime[1] < 1600000) Then{ exitlong("bexit"); ExitShort("sexit"); } 진입신호 이후 이문장의 청산신호가 자주 발생됩니다. 이문장은 포지션보유시 마감시간이되면 강제청산하라는 신호아닌가요? 감사합니다. ===================================================================== input : af1(0.01),max1(0.1); input : N(1); var : para1(0),T1(0); var : Bcond1(false); var : Scond1(false); para1 = sar(af1,max1); if stime >= 170000 or stime < 160000 Then{ if crossup(C,para1) Then{ Bcond1 = false; var1 = H; T1 = 1; } if CrossDown(C,para1) Then{ Scond1 = false; var1 = L; T1 = -1; } if T1 == 1 and Bcond1 == false Then buy("B1",AtStop,var1+PriceScale*1); if T1 == -1 and Scond1 == false Then sell("S1",AtStop,var1-PriceScale*1); if MarketPosition == 1 then{ Bcond1 = true; if CrossDown(c,para1) Then exitlong("bx1",OnClose,def); } if MarketPosition == -1 then{ Scond1 = true; if crossup(c,para1) Then ExitShort("sx1",OnClose,def,"S1"); } } SetStopLoss(PriceScale*10,PointStop); SetStopTrailing(PriceScale*N,PriceScale*20,PointStop); if stime == 160000 or (stime > 160000 and stime[1] < 1600000) Then{ exitlong("bexit"); ExitShort("sexit"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-08-19 11:08:25

안녕하세요 예스스탁입니다. 기존식이 봉완성시 포지션진입여부로 진입이 제어되고 있는데 손절이 너무 짭아 같은봉에 진입하고 청산이 되면 봉완성시에 포지션이 계속 모포지션이므로 Bcond1나 Scond1가 계속 false로 되어 추가로 또 진입을 합니다. 손절이 짧아 포지션여부로 제어가 되지 않으므로 봉의 가격으로 판단하게 했습니다. 시간청산에 시간값이 0이 하나더 추가되어 있어 수정했습니다. input : af1(0.01),max1(0.1); input : N(1); var : para1(0),T1(0); var : Bcond1(false); var : Scond1(false); para1 = sar(af1,max1); if stime >= 170000 or stime < 160000 Then{ if crossup(C,para1) Then{ Bcond1 = false; var1 = H; T1 = 1; } if CrossDown(C,para1) Then{ Scond1 = false; var1 = L; T1 = -1; } if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then Bcond1 = true; if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var1[1]-PriceScale*1 Then Scond1 = true; if T1 == 1 and Bcond1 == false Then buy("B1",AtStop,var1+PriceScale*1); if T1 == -1 and Scond1 == false Then sell("S1",AtStop,var1-PriceScale*1); if MarketPosition == 1 then{ if CrossDown(c,para1) Then exitlong("bx1",OnClose,def); } if MarketPosition == -1 then{ Scond1 = true; if crossup(c,para1) Then ExitShort("sx1",OnClose,def,"S1"); } } SetStopLoss(PriceScale*10,PointStop); SetStopTrailing(PriceScale*N,PriceScale*20,PointStop); if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{ exitlong("bexit"); ExitShort("sexit"); } 즐거운 하루되세요 > 베드로 님이 쓴 글입니다. > 제목 : 문의드립니다. > 안녕하세요. 해선 Crude oil종목에 적용 하여보니 아래식에서 2가지문제가 발생 합니다 수정 부탁드립니다. 수정사항 1.crossup or crossdown 발생시 진입과 청산이 한번만 발생되어야 하나 익절과 손절폭이 좁아 한봉에서 진입과 청산이 발생되면 또다시 신호가 발생됩니다.(진입후 2봉이내 청산발생시 동일 현상) 진입제어 추가하여주세요 2. if stime == 160000 or (stime > 160000 and stime[1] < 1600000) Then{ exitlong("bexit"); ExitShort("sexit"); } 진입신호 이후 이문장의 청산신호가 자주 발생됩니다. 이문장은 포지션보유시 마감시간이되면 강제청산하라는 신호아닌가요? 감사합니다. ===================================================================== input : af1(0.01),max1(0.1); input : N(1); var : para1(0),T1(0); var : Bcond1(false); var : Scond1(false); para1 = sar(af1,max1); if stime >= 170000 or stime < 160000 Then{ if crossup(C,para1) Then{ Bcond1 = false; var1 = H; T1 = 1; } if CrossDown(C,para1) Then{ Scond1 = false; var1 = L; T1 = -1; } if T1 == 1 and Bcond1 == false Then buy("B1",AtStop,var1+PriceScale*1); if T1 == -1 and Scond1 == false Then sell("S1",AtStop,var1-PriceScale*1); if MarketPosition == 1 then{ Bcond1 = true; if CrossDown(c,para1) Then exitlong("bx1",OnClose,def); } if MarketPosition == -1 then{ Scond1 = true; if crossup(c,para1) Then ExitShort("sx1",OnClose,def,"S1"); } } SetStopLoss(PriceScale*10,PointStop); SetStopTrailing(PriceScale*N,PriceScale*20,PointStop); if stime == 160000 or (stime > 160000 and stime[1] < 1600000) Then{ exitlong("bexit"); ExitShort("sexit"); }