커뮤니티

오류인것 같은데....

프로필 이미지
신기가
2018-01-22 12:13:42
222
글번호 115954
답변완료

첨부 이미지

현재 설정 인데요 input : left(3),right(3); var : T(0); if SwingHigh(1,H,left,right,left+right+1) != -1 Then { T = 1; var1 = H[right]; } if SwingLow(1,L,left,right,left+right+1) != -1 Then { T = -1; var2 = L[right]; } if MarketPosition <= 0 and T == -1 and C >= var2+PriceScale*30 Then buy("b",AtStop,var2+PriceScale*30); if MarketPosition >= 0 and T == 1 and C <= var2-PriceScale*30 Then sell("s",AtStop,var2-PriceScale*30); if MarketPosition == 1 then{ ExitLong("bx1",AtLimit,EntryPrice+(PriceScale*20),"",Floor(MaxContracts*0.5)); if MarketPosition == 1 then ExitLong("bx3",AtStop,highest(H,BarsSinceEntry)-(PriceScale*30),"",Floor(MaxContracts*1.0)); sell("s1",AtStop,highest(H,BarsSinceEntry)-(PriceScale*30)); if LatestExitName(0) == "s1" then ExitLong("s1x1",AtLimit,EntryPrice-(PriceScale*20),"",Floor(MaxContracts*0.5)); if LatestExitName(0) == "bx1" then ExitLong("bx2",AtStop,highest(H,BarsSinceEntry)-(PriceScale*30),"",Floor(MaxContracts*0.5)); } if MarketPosition == -1 then{ ExitShort("sx1",AtLimit,EntryPrice-(PriceScale*20),"",Floor(MaxContracts*0.5)); if MarketPosition == -1 then ExitShort("sx3",AtStop,Lowest(L,BarsSinceEntry)+(PriceScale*30),"",Floor(MaxContracts*1.0)); buy("b1",AtStop,Lowest(L,BarsSinceEntry)+(PriceScale*30)); if LatestExitName(0) == "b1" then ExitShort("b1x1",AtLimit,EntryPrice+(PriceScale*20),"",Floor(MaxContracts*0.5)); if LatestExitName(0) == "sx1" then ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+(PriceScale*30),"",Floor(MaxContracts*0.5)); } 아래사진처럼 매도후 동일가에 매수처리되는 이유가 로직의 어떤 이유 때문인가요? 그리고 그 오류를 해결하려면 로직을 어떻게 수정해야 하나요? 부탁합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-01-23 14:28:02

안녕하세요 예스스탁입니다. input : left(3),right(3); var : T(0); if SwingHigh(1,H,left,right,left+right+1) != -1 Then { T = 1; var1 = H[right]; } if SwingLow(1,L,left,right,left+right+1) != -1 Then { T = -1; var2 = L[right]; } if MarketPosition <= 0 and T == -1 and C >= var2+PriceScale*30 Then buy("b",AtStop,var2+PriceScale*30); 11시 15분봉에 발생한 신호는 위 "b" 신호입니다. 11시 10분봉에서 if문이 만족하고 다음봉에서 var2+PriceScale*30 이상의 시세가 발생하면 신호가 발생하는데 시가(3.216)가 해당 가격 이상이므로 시세조건 충족되어 발생한 것입니다. 이전 11시10분봉의 매도진입가격과는 관계없습니다. 수식적으로 어떤 오류가 아닙니다. 단지 조건만족해서 발생한 신호가 이전과 가격이 같았을 뿐입니다. 즐거운 하루되세요 > 신기가 님이 쓴 글입니다. > 제목 : 오류인것 같은데.... > 현재 설정 인데요 input : left(3),right(3); var : T(0); if SwingHigh(1,H,left,right,left+right+1) != -1 Then { T = 1; var1 = H[right]; } if SwingLow(1,L,left,right,left+right+1) != -1 Then { T = -1; var2 = L[right]; } if MarketPosition <= 0 and T == -1 and C >= var2+PriceScale*30 Then buy("b",AtStop,var2+PriceScale*30); if MarketPosition >= 0 and T == 1 and C <= var2-PriceScale*30 Then sell("s",AtStop,var2-PriceScale*30); if MarketPosition == 1 then{ ExitLong("bx1",AtLimit,EntryPrice+(PriceScale*20),"",Floor(MaxContracts*0.5)); if MarketPosition == 1 then ExitLong("bx3",AtStop,highest(H,BarsSinceEntry)-(PriceScale*30),"",Floor(MaxContracts*1.0)); sell("s1",AtStop,highest(H,BarsSinceEntry)-(PriceScale*30)); if LatestExitName(0) == "s1" then ExitLong("s1x1",AtLimit,EntryPrice-(PriceScale*20),"",Floor(MaxContracts*0.5)); if LatestExitName(0) == "bx1" then ExitLong("bx2",AtStop,highest(H,BarsSinceEntry)-(PriceScale*30),"",Floor(MaxContracts*0.5)); } if MarketPosition == -1 then{ ExitShort("sx1",AtLimit,EntryPrice-(PriceScale*20),"",Floor(MaxContracts*0.5)); if MarketPosition == -1 then ExitShort("sx3",AtStop,Lowest(L,BarsSinceEntry)+(PriceScale*30),"",Floor(MaxContracts*1.0)); buy("b1",AtStop,Lowest(L,BarsSinceEntry)+(PriceScale*30)); if LatestExitName(0) == "b1" then ExitShort("b1x1",AtLimit,EntryPrice+(PriceScale*20),"",Floor(MaxContracts*0.5)); if LatestExitName(0) == "sx1" then ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+(PriceScale*30),"",Floor(MaxContracts*0.5)); } 아래사진처럼 매도후 동일가에 매수처리되는 이유가 로직의 어떤 이유 때문인가요? 그리고 그 오류를 해결하려면 로직을 어떻게 수정해야 하나요? 부탁합니다.