커뮤니티

문의드립니다.

프로필 이미지
마코
2014-03-19 22:12:21
131
글번호 73649
답변완료
안녕하십니까 며칠 전에 알려주신 수식인데, 익절을 한 후 다시 포지션 방향으로 재진입을 해버립니다. 익절 후 다음 신호까지 재진입을 하지 않도록 수식 좀 수정 부탁드립니다. 감사합니다. input : X(1),Y(1),AA(1),BB(1),N(3),LL(-2); var : DH(0),DL(0),cnt(0),count(0),NP(0),PreNP(0),DayPL(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } NP = NetProfit; if date != date[1] Then{ DH = H; DL = L; PreNP = NP; } daypl = NP-PreNP; if dayindex > 0 then{ if H > DH Then{ DH = H; var1 = 1; } if L < DL Then{ DL = L; var1 = -1; } } if var1 == 1 and count < N and dayPL > LL Then Sell("s",AtStop,DH-X); if var1 == -1 and count < N and dayPL > LL Then Buy("b",AtStop,DL+Y); SetStopProfittarget(AA,PointStop); SetStopLoss(BB,PointStop); if MarketPosition == 1 Then{ ExitLong("bx1",AtStop,EntryPrice+((LL)-(dayPL))); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,EntryPrice+(-(LL)+(dayPL))); } 즐거운 하루되세요 > 마코 님이 쓴 글입니다. > 제목 : 문의드립니다. > 고점을 갱신한 후 X포인트 하락하면 매도. 저점을 갱신한 후 Y포인트 상승하면 매수. 익절 A 포인트, 손절 B 포인트 하루 매매 N 번 하루 누적손절 L 포인트 수식 부탁드립니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-03-20 14:54:21

안녕하세요 예스스탁입니다. 안녕하세요 예스스탁입니다. input : X(1),Y(1),AA(1),BB(1),N(3),LL(-2); var : DH(0),DL(0),cnt(0),count(0),NP(0),PreNP(0),DayPL(0); var : Bcond(false),Scond(false); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } NP = NetProfit; if date != date[1] Then{ DH = H; DL = L; PreNP = NP; } daypl = NP-PreNP; if dayindex > 0 then{ if H > DH Then{ DH = H; var1 = 1; } if L < DL Then{ DL = L; var1 = -1; } } Bcond = MarketPosition == 0 and ExitDate(1) == sdate and IsExitName("StopProfittarget",1) == true and MarketPosition(1) == 1; Scond = MarketPosition == 0 and ExitDate(1) == sdate and IsExitName("StopProfittarget",1) == true and MarketPosition(1) == -1; if MarketPosition >= 0 and var1 == 1 and count < N and dayPL > LL and (count == 0 or (count >= 1 and Bcond == false)) Then Sell("s",AtStop,DH-X); if MarketPosition <= 0 and var1 == -1 and count < N and dayPL > LL and (count == 0 or (count >= 1 and Scond == false)) Then Buy("b",AtStop,DL+Y); SetStopProfittarget(AA,PointStop); SetStopLoss(BB,PointStop); if MarketPosition == 1 Then{ ExitLong("bx1",AtStop,EntryPrice+((LL)-(dayPL))); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,EntryPrice+(-(LL)+(dayPL))); } 즐거운 하루되세요 즐거운 하루되세요 > 마코 님이 쓴 글입니다. > 제목 : 문의드립니다. > 안녕하십니까 며칠 전에 알려주신 수식인데, 익절을 한 후 다시 포지션 방향으로 재진입을 해버립니다. 익절 후 다음 신호까지 재진입을 하지 않도록 수식 좀 수정 부탁드립니다. 감사합니다. input : X(1),Y(1),AA(1),BB(1),N(3),LL(-2); var : DH(0),DL(0),cnt(0),count(0),NP(0),PreNP(0),DayPL(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } NP = NetProfit; if date != date[1] Then{ DH = H; DL = L; PreNP = NP; } daypl = NP-PreNP; if dayindex > 0 then{ if H > DH Then{ DH = H; var1 = 1; } if L < DL Then{ DL = L; var1 = -1; } } if var1 == 1 and count < N and dayPL > LL Then Sell("s",AtStop,DH-X); if var1 == -1 and count < N and dayPL > LL Then Buy("b",AtStop,DL+Y); SetStopProfittarget(AA,PointStop); SetStopLoss(BB,PointStop); if MarketPosition == 1 Then{ ExitLong("bx1",AtStop,EntryPrice+((LL)-(dayPL))); } if MarketPosition == -1 Then{ ExitShort("sx1",AtStop,EntryPrice+(-(LL)+(dayPL))); } 즐거운 하루되세요 > 마코 님이 쓴 글입니다. > 제목 : 문의드립니다. > 고점을 갱신한 후 X포인트 하락하면 매도. 저점을 갱신한 후 Y포인트 상승하면 매수. 익절 A 포인트, 손절 B 포인트 하루 매매 N 번 하루 누적손절 L 포인트 수식 부탁드립니다. 감사합니다.