커뮤니티

재수정 요망합니다.

프로필 이미지
몸통공격
2012-04-30 11:39:37
499
글번호 50635
답변완료

첨부 이미지

손절과 익절을 반복하여 계속 매매하려고 합니다. 아래와 같이 입력했더니 익절 되면 익절됐던 방향으로는 진입을 안하고 다음 반대 신호를 기다렸다가 진입해야 하는데 익절 후에도 바로 조건이 맞으면 익절했던 방향으로 재진입이 되어 버리네요. (첨부 그림 참조) 내일 휴일 잘 보내시기 바랍니다. ------------------------------------------------------------------------------ 인푸트 부분 생략 var : count(0),cnt(0); count = 0; for cnt = 0 to 20 { if sdate == EntryDate(cnt) Then count = count+1; } value1 =1번식; value2 =2번식; Condition1 = count >= 1 and ExitDate(1) == sdate and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true); if count == 0 or MarketPosition != 0 or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0) or (MarketPosition == 0 and Condition1 == true and BarsSinceExit(1) > 0) then { # 매수 If 매수조건 then { buy(); } # 매도 If 매도조건 Then { Sell(); } } #매도청산 if MarketPosition(1) == -1 and 매도청산조건 then { exitshort(); } #매수청산 if MarketPosition(1) == 1 and 매수청산조건 Then { exitlong(); } SetStopLoss(0.8,PointStop); SetStopProfittarget(1.0,PointStop); SetStopEndofday(150430);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-04-30 12:57:22

안녕하세요 예스스탁입니다. 식을 수정했습니다. 아래와 같이 발생합니다. 1. 당일첫진입은 매수진입이나 매도진입 중 먼저 만족한 조건으로 진입 2. 당일 두번째 진입부터 직전진입이 목표이익이나 손절매로 청산된 경우는 청산 후 한봉이상 경우하고 반대방향으로만 진입허용 3. 당일 두번째 진입부터 bx나 sx로 청산된 경우는 청산이후 한봉이상 경과 후 먼저 만족한 조건으로 진입 var : count(0),cnt(0); count = 0; for cnt = 0 to 20 { if sdate == EntryDate(cnt) Then count = count+1; } value1 =1번식; value2 =2번식; Condition1 = count >= 1 and ExitDate(1) == sdate and (IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true); if count == 0 or MarketPosition != 0 or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0 ) or (MarketPosition == 0 and Condition1 == true and BarsSinceExit(1) > 0 and MarketPosition(1) != 1) then{ If 매수조건 then{ buy(); } } if count == 0 or MarketPosition != 0 or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0 ) or (MarketPosition == 0 and Condition1 == false and BarsSinceExit(1) > 0 and MarketPosition(1) != 1) Then{ If 매도조건 Then{ Sell(); } } if MarketPosition(1) == -1 and 매도청산조건 then { exitshort("bx"); } if MarketPosition(1) == 1 and 매수청산조건 Then { exitlong("sx"); } SetStopLoss(0.8,PointStop); SetStopProfittarget(1.0,PointStop); SetStopEndofday(150430); 의도하신 내용과 다르시면 전화주시기 바랍니다. 02-3453-1060 즐거운 하루되세요