커뮤니티

문의드립니다.

프로필 이미지
회원
2013-06-04 15:45:09
222
글번호 63983
답변완료
30695번 문의 답변 감사합니다. 2번 답변에 대한 식의 결과값이 좀 다르게 나옵니다. bb, ss 가 정확한 값에서 이뤄지지 않는것 같고, sx, bx도 좀 이상한거 같은데, 찾기가 힘드네요. 죄송하지만 검토한번 부탁드리겠습니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-06-05 11:17:43

안녕하세요 예스스탁입니다. 2번식의 경우 중간에 크로스가 발생하면 첫진입인 b나 s의 수량을 청산하게 됩니다. 포지션이 진행중일때는 청산의 이름등을 확인할 방법이 없어 중간에 나온 청산이 어떤 청산인지 인지하기 어렵습니다. bx의 경우 최종진입 후 최저가에서 일정%만틈 청산하게 되는데 이때 진입 후 수량이 줄어든 횟수가 사용됩니다. 중간에 크로스가 발생하면 청산횟수는 증가하므로 청산 %설정이 한단계 건너뒤게 됩니다. 식안에 크로스가 발생 후 수량이 줄어드는 것으로 처리를 했지만 해당 부분이 정확치 않을수 있습니다. input : N(1),X(3); var : Bxcnt(0),Sxcnt(0),Xper(0); Xper = N/2; var1 = ma(c,60); if MarketPosition == 0 and crossup(c,var1) Then buy("b",OnClose,def,1); if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then value1 = L; if L < value1 Then value1 = L; if CurrentContracts < CurrentContracts[1] and CrossDown(C[1],var1[1]) Then{ Bxcnt = Bxcnt+1; Condition1 = true; } if CurrentEntries < X and Condition1 == false Then buy("bb",atlimit,EntryPrice*(1-(N*CurrentEntries)/100),1); ExitLong("bx",Atlimit,value1*(1+(Xper*Bxcnt)/100),"",1,1); ExitLong("bloss",AtStop,EntryPrice*(1-(N*X)/100)); if CrossDown(c,var1) Then ExitLong("bxx",OnClose,def,"b"); } Else{ Condition1 = false; Bxcnt = 1; } if MarketPosition == 0 and CrossDown(c,var1) Then Sell("s",OnClose,def,1); if MarketPosition == -1 Then{ if CurrentContracts > CurrentContracts[1] Then value2 = H; if H > value2 Then value2 = H; if CurrentContracts < CurrentContracts[1] and CrossUp(C[1],var1[1]) Then{ Sxcnt = Sxcnt+1; Condition2 = true; } if CurrentEntries < X and Condition2 == false Then Sell("ss",atlimit,EntryPrice*(1+(N*CurrentEntries)/100),1); ExitShort("sx",Atlimit,value2*(1-(Xper*Bxcnt)/100),"",1,1); ExitShort("sloss",AtStop,EntryPrice*(1+(N*X)/100)); if crossup(c,var1) Then ExitShort("sxx",OnClose,def,"s"); } Else{ Condition2 = false; Sxcnt = 1; } 즐거운 하루되세요 > HI_jhy6835 님이 쓴 글입니다. > 제목 : 문의드립니다. > 30695번 문의 답변 감사합니다. 2번 답변에 대한 식의 결과값이 좀 다르게 나옵니다. bb, ss 가 정확한 값에서 이뤄지지 않는것 같고, sx, bx도 좀 이상한거 같은데, 찾기가 힘드네요. 죄송하지만 검토한번 부탁드리겠습니다.