커뮤니티

누적손실시 진입제한 수식인데 오류가 있습니다.

프로필 이미지
참새사냥꾼
2015-07-07 22:20:07
149
글번호 88135
답변완료

첨부 이미지

게시판의 문의로 아래와 같은 수식을 받았습니다. 그런데 실제 시스템에 반영을 해보니... 손실이 15틱인데 신규진입이 안되고 있습니다. 6월5일을 보면 누적손실이 15틱인데.. 신규진입이 안됩니다. 수정해주신 수식은 아래와 같습니다. 확인부탁드립니다. 안녕하세요 예스스탁입니다. Input : shortPeriod(5), longPeriod(20), period(15); Input : 거래시간1(1), 시작시간1(090000), 끝시간1(020000); var : NP(0),preNP(0),dayPl(0); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); value3 = ma(C, Period); Value4 = C/Value1*100; Value5 = PositionProfit; condition2 = IsExitName("stoploss",1); condition3 = 거래시간1==1 and (stime>=시작시간1 or stime<끝시간1); NP = NetProfit; if stime == 시작시간1 or (stime > 시작시간1 and stime[1] < 시작시간1) Then{ preNP = NP; } DayPl = NP-PreNP; if condition3==true then { If condition2 == false then {IF 매수조건 and (daypl < PriceScale*20 and daypl > -PriceScale*30) Then Buy("매수"); } Else { IF BarsSinceExit(1) >= 3 and 매수조건 and (daypl < PriceScale*20 and daypl > -PriceScale*30) Then Buy("매수진입"); } IF BarsSinceEntry > 3 and 청산조건 Then ExitLong("매도"); } SetStopTrailing(0.1,0.35,PointStop); SetStopLoss(0.10,PointStop); # 새벽2시50에 모두 청산하고자 하시면 아래 내용도 추가하시면 됩니다. if stime == 025000 or (stime > 025000 and stime[1] < 025000) Then { exitlong(); } 즐거운 하루되세요
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-07-08 09:42:55

> 참새사냥꾼 님이 쓴 글입니다. > 제목 : 누적손실시 진입제한 수식인데 오류가 있습니다. > 게시판의 문의로 아래와 같은 수식을 받았습니다. 그런데 실제 시스템에 반영을 해보니... 손실이 15틱인데 신규진입이 안되고 있습니다. 6월5일을 보면 누적손실이 15틱인데.. 신규진입이 안됩니다. 수정해주신 수식은 아래와 같습니다. 확인부탁드립니다. 안녕하세요 예스스탁입니다. Input : shortPeriod(5), longPeriod(20), period(15); Input : 거래시간1(1), 시작시간1(090000), 끝시간1(020000); var : NP(0),preNP(0),dayPl(0); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); value3 = ma(C, Period); Value4 = C/Value1*100; Value5 = PositionProfit; condition2 = IsExitName("stoploss",1); condition3 = 거래시간1==1 and (stime>=시작시간1 or stime<끝시간1); NP = NetProfit; if stime == 시작시간1 or (stime > 시작시간1 and stime[1] < 시작시간1) Then{ preNP = NP; } DayPl = NP-PreNP; if condition3==true then { If condition2 == false then {IF 매수조건 and (daypl < PriceScale*20 and daypl > -PriceScale*30) Then Buy("매수"); } Else { IF BarsSinceExit(1) >= 3 and 매수조건 and (daypl < PriceScale*20 and daypl > -PriceScale*30) Then Buy("매수진입"); } IF BarsSinceEntry > 3 and 청산조건 Then ExitLong("매도"); } SetStopTrailing(0.1,0.35,PointStop); SetStopLoss(0.10,PointStop); # 새벽2시50에 모두 청산하고자 하시면 아래 내용도 추가하시면 됩니다. if stime == 025000 or (stime > 025000 and stime[1] < 025000) Then { exitlong(); } 즐거운 하루되세요