커뮤니티

함수수정요청(226호)

프로필 이미지
통큰베팅
2015-12-18 20:53:41
119
글번호 93609
답변완료
안녕하세요? 아래의 함수에서 매수전략만 사용하고 싶습니다. 매수가 매도 신호의 영향을 받아 매도 신호를 단순 삭제하면 매수 신호가 달라져 버립니다. 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);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-12-21 09:44:11

안녕하세요 예스스탁입니다. 매도식을 매수청산식으로 변경하시면 됩니다. 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 exitlong("S"); SetStopLoss(0.5,PercentStop); SetStopProfittarget(1,PercentStop); SetStopInactivity(1,5,PercentStop); 즐거운 하루되세요 > 통큰베팅 님이 쓴 글입니다. > 제목 : 함수수정요청(226호) > 안녕하세요? 아래의 함수에서 매수전략만 사용하고 싶습니다. 매수가 매도 신호의 영향을 받아 매도 신호를 단순 삭제하면 매수 신호가 달라져 버립니다. 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);