커뮤니티

함수수정요청(226호, 진입제한)

프로필 이미지
통큰베팅
2015-12-18 21:02:14
119
글번호 93610
답변완료
안녕하세요? 아래 전략을 사용시 전일청산 수익이 발생시 당일은 매매를 하지 않고 전일청산 손실이 발생시 당일에 매매를 하고자합니다. 참고로 비슷한 함수를 다음을 사용하여 작성해주셨었습니다. var : entry(0),NP(0),NP1(0),NP2(0); #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition1 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition1 = false; } 즉 전일 거래로 수익이 발생했으면 false입니다. ----------------------------------------------------------------------------------- input : xtime(60000); var : tcond(false),cond1(false),cond2(false); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop);
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2015-12-21 10:01:29

안녕하세요 예스스탁입니다. input : xtime(60000); var : tcond(false),cond1(false),cond2(false); var : entry(0),NP(0),NP1(0),NP2(0); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition3 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition3 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == false and Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition1 == false and Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수수정요청(226호, 진입제한) > 안녕하세요? 아래 전략을 사용시 전일청산 수익이 발생시 당일은 매매를 하지 않고 전일청산 손실이 발생시 당일에 매매를 하고자합니다. 참고로 비슷한 함수를 다음을 사용하여 작성해주셨었습니다. var : entry(0),NP(0),NP1(0),NP2(0); #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition1 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition1 = false; } 즉 전일 거래로 수익이 발생했으면 false입니다. ----------------------------------------------------------------------------------- input : xtime(60000); var : tcond(false),cond1(false),cond2(false); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop);
프로필 이미지

통큰베팅

2015-12-21 10:50:26

답변 감사드립니다. 그런데 답변 주신 수식 다시 한번만 더 검수 부탁드립니다. 작성해주신 식을 시뮬해보면 매수신호는 안나오고 매도만 나오고 있습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 함수수정요청(226호, 진입제한) > 안녕하세요 예스스탁입니다. input : xtime(60000); var : tcond(false),cond1(false),cond2(false); var : entry(0),NP(0),NP1(0),NP2(0); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition3 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition3 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == false and Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition1 == false and Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수수정요청(226호, 진입제한) > 안녕하세요? 아래 전략을 사용시 전일청산 수익이 발생시 당일은 매매를 하지 않고 전일청산 손실이 발생시 당일에 매매를 하고자합니다. 참고로 비슷한 함수를 다음을 사용하여 작성해주셨었습니다. var : entry(0),NP(0),NP1(0),NP2(0); #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition1 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition1 = false; } 즉 전일 거래로 수익이 발생했으면 false입니다. ----------------------------------------------------------------------------------- input : xtime(60000); var : tcond(false),cond1(false),cond2(false); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop);
프로필 이미지

예스스탁 예스스탁 답변

2015-12-21 11:05:11

안녕하세요 예스스탁입니다. 변수에 중복이 있었습니다. 수정한 식입니다. input : xtime(60000); var : tcond(false),cond1(false),cond2(false); var : entry(0),NP(0),NP1(0),NP2(0); #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition3 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition3 = false; MessageLog("%s",Condition3); } if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition3 == true and Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition3 == true and Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : Re : Re : 함수수정요청(226호, 진입제한) > 답변 감사드립니다. 그런데 답변 주신 수식 다시 한번만 더 검수 부탁드립니다. 작성해주신 식을 시뮬해보면 매수신호는 안나오고 매도만 나오고 있습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 함수수정요청(226호, 진입제한) > 안녕하세요 예스스탁입니다. input : xtime(60000); var : tcond(false),cond1(false),cond2(false); var : entry(0),NP(0),NP1(0),NP2(0); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition3 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition3 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == false and Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition1 == false and Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수수정요청(226호, 진입제한) > 안녕하세요? 아래 전략을 사용시 전일청산 수익이 발생시 당일은 매매를 하지 않고 전일청산 손실이 발생시 당일에 매매를 하고자합니다. 참고로 비슷한 함수를 다음을 사용하여 작성해주셨었습니다. var : entry(0),NP(0),NP1(0),NP2(0); #총손익(청산완료된 거래만) NP = NetProfit; #영업일 변경 if bdate != bdate[1] Then{ entry = 0; NP1 = NP[1]; #전영업일까지의 총손익 NP2 = NP1[1];#전전영업일까지의 총손익 Condition1 = true; if NP1 > NP2 Then #전영업일까지의 손익이 전전영업일까지의 손익보다 크면 false Condition1 = false; } 즉 전일 거래로 수익이 발생했으면 false입니다. ----------------------------------------------------------------------------------- input : xtime(60000); var : tcond(false),cond1(false),cond2(false); if bdate != bdate[1] Then{ Tcond = true; Condition1 = false; Condition2 = false; } if stime == xtime or (stime > xtime and stime[1] < Xtime) Then{ Tcond = false; } var1 = ma(c,5); var2 = ma(c,10); cond1 = C > var1 and var1 > var2; cond2 = C < var1 and var1 < var2; if cond1 == true and cond1[1] == false then Condition1 = true; if cond2 == true and cond2[1] == false then Condition2 = true; if Tcond == true And Condition1 == true and cond1 == true and var1 > var1[1] and var2 > var2[1] Then buy("B"); if Tcond == true And Condition2 == true and Cond2 == true and var1 < var1[1] and var2 < var2[1] Then sell("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop);