커뮤니티

수식 질문드립니다.

프로필 이미지
캣피쉬
2021-06-22 08:34:37
1548
글번호 150161
답변완료

첨부 이미지

예를들어서 현재 buy 포지션 유지중인데, 익절이 20 pt 입니다. 그런데 익절 나오기전에 또 buy 신호가 뜬다면 여기서 추가로 한개 더 진입하게할수없나요? 사진에서 피라미딩하용하면 하루에 몰아서 다 때려넣는데, 이렇게 말고 신호뜨면 하루 1개만 추가진입하게하고 싶습니다. 반대신호 뜨면 다 청산하고 다시 한개만 진입하고,, data --------------------- # input : StartTime(90500),EndTime(151000); Input : s1(120), s2(200); //input : s11(28),s12(265); input : 손절(5.6); input : 익절(30.2); //input : way(9),road(-8),road2(-8); //input : 최소이익(2),손실범위(0.1); input : bf11(0.2),sf11(-0.85),bf12(0.85),sf12(-0.5); input : bf13(0.8),sf13(-0.8),bf14(0.5),sf14(-0.32); //var : condi(0); var : Tcond(false,Data1); var : C2(0,Data2); var : C3(0,Data3); var : C4(0,Data4); var : C5(0,Data5); var : C6(0,Data6); var : C7(0,Data7); value1 = ma(c2,s1); value2 = ma(c2,s2); //value12 = Ma(c2,600); //value13 = Ma(c3,600); //value14 = Ma(c4,600); //value15 = Ma(c5,600); value12 = Average(c2,600); value13 = Average(c3,600); value14 = Average(c4,600)*4; value15 = Average(c5,600)*4; if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; C2 = Data2(c); C3 = Data3(c); C4 = Data4(c); C5 = Data5(c); C6 = Data6(c); C7 = Data7(c); if Tcond == true Then { If #CrossUp(Value3,0) value13 < -0.32 and (value14 < -0.32 or value14>0.32) //and c6+c7>road #39.62 //and c2<bf11 //and c3<bf12 #47.86 //and c4<bf13 //and c5<bf14 Then { Buy(); } If #CrossDown(Value3,0) value13 > 0.32 and (value14 < -0.32 or value14 > 0.32) //and c6+c7<-road //and c2>sf11 //and c3>sf12 //and c4>sf13 //and c5>sf14 Then { Sell(); } } # #SetStopEndofday(EndTime); SetStoploss(손절,PointStop); SetStopProfittarget(익절,PointStop); #SetStopContract();#생략가능 #SetStopTrailing(손실범위 , 최소이익 , PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-06-22 10:32:12

안녕하세요 예스스탁입니다. 매수나 매도진입을 하루에 한번만 발생하게 수정해 드립니다. 포지션 진행중 목표수익청산이 발생하기 전에만 하루에 한번씩 진입합니다. # input : StartTime(90500),EndTime(151000); Input : s1(120), s2(200); //input : s11(28),s12(265); input : 손절(5.6); input : 익절(30.2); //input : way(9),road(-8),road2(-8); //input : 최소이익(2),손실범위(0.1); input : bf11(0.2),sf11(-0.85),bf12(0.85),sf12(-0.5); input : bf13(0.8),sf13(-0.8),bf14(0.5),sf14(-0.32); //var : condi(0); var : Tcond(false,Data1); var : C2(0,Data2); var : C3(0,Data3); var : C4(0,Data4); var : C5(0,Data5); var : C6(0,Data6); var : C7(0,Data7); var : BEntry(False,Data1),SEntry(False,Data1); var : BPXcond(False,Data1),SPXcond(False,Data1); value1 = ma(c2,s1); value2 = ma(c2,s2); //value12 = Ma(c2,600); //value13 = Ma(c3,600); //value14 = Ma(c4,600); //value15 = Ma(c5,600); value12 = Average(c2,600); value13 = Average(c3,600); value14 = Average(c4,600)*4; value15 = Average(c5,600)*4; if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Bentry = true; Sentry = true; } C2 = Data2(c); C3 = Data3(c); C4 = Data4(c); C5 = Data5(c); C6 = Data6(c); C7 = Data7(c); if MarketPosition == 1 Then { if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "StopProfitTarget" Then BPXcond = True; } Else BPXcond = False; if MarketPosition == -1 Then { if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "StopProfitTarget" Then SPXcond = True; } Else SPXcond = False; if Tcond == true Then { If BEntry == true and #CrossUp(Value3,0) value13 < -0.32 and (value14 < -0.32 or value14>0.32) //and c6+c7>road #39.62 //and c2<bf11 //and c3<bf12 #47.86 //and c4<bf13 //and c5<bf14 Then { Bentry = False; if MarketPosition == 0 or (MarketPosition == 1 and BPXcond == False) Then Buy(); } If Sentry == true and #CrossDown(Value3,0) value13 > 0.32 and (value14 < -0.32 or value14 > 0.32) //and c6+c7<-road //and c2>sf11 //and c3>sf12 //and c4>sf13 //and c5>sf14 Then { SEntry = False; if MarketPosition == 0 or (MarketPosition == 1 and SPXcond == False) Then Sell(); } } # #SetStopEndofday(EndTime); SetStoploss(손절,PointStop); SetStopProfitTarget(익절,PointStop); #SetStopContract();#생략가능 #SetStopTrailing(손실범위 , 최소이익 , PointStop); 즐거운 하루되세요 > 캣피쉬 님이 쓴 글입니다. > 제목 : 수식 질문드립니다. > 예를들어서 현재 buy 포지션 유지중인데, 익절이 20 pt 입니다. 그런데 익절 나오기전에 또 buy 신호가 뜬다면 여기서 추가로 한개 더 진입하게할수없나요? 사진에서 피라미딩하용하면 하루에 몰아서 다 때려넣는데, 이렇게 말고 신호뜨면 하루 1개만 추가진입하게하고 싶습니다. 반대신호 뜨면 다 청산하고 다시 한개만 진입하고,, data --------------------- # input : StartTime(90500),EndTime(151000); Input : s1(120), s2(200); //input : s11(28),s12(265); input : 손절(5.6); input : 익절(30.2); //input : way(9),road(-8),road2(-8); //input : 최소이익(2),손실범위(0.1); input : bf11(0.2),sf11(-0.85),bf12(0.85),sf12(-0.5); input : bf13(0.8),sf13(-0.8),bf14(0.5),sf14(-0.32); //var : condi(0); var : Tcond(false,Data1); var : C2(0,Data2); var : C3(0,Data3); var : C4(0,Data4); var : C5(0,Data5); var : C6(0,Data6); var : C7(0,Data7); value1 = ma(c2,s1); value2 = ma(c2,s2); //value12 = Ma(c2,600); //value13 = Ma(c3,600); //value14 = Ma(c4,600); //value15 = Ma(c5,600); value12 = Average(c2,600); value13 = Average(c3,600); value14 = Average(c4,600)*4; value15 = Average(c5,600)*4; if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; C2 = Data2(c); C3 = Data3(c); C4 = Data4(c); C5 = Data5(c); C6 = Data6(c); C7 = Data7(c); if Tcond == true Then { If #CrossUp(Value3,0) value13 < -0.32 and (value14 < -0.32 or value14>0.32) //and c6+c7>road #39.62 //and c2<bf11 //and c3<bf12 #47.86 //and c4<bf13 //and c5<bf14 Then { Buy(); } If #CrossDown(Value3,0) value13 > 0.32 and (value14 < -0.32 or value14 > 0.32) //and c6+c7<-road //and c2>sf11 //and c3>sf12 //and c4>sf13 //and c5>sf14 Then { Sell(); } } # #SetStopEndofday(EndTime); SetStoploss(손절,PointStop); SetStopProfittarget(익절,PointStop); #SetStopContract();#생략가능 #SetStopTrailing(손실범위 , 최소이익 , PointStop);