커뮤니티

수정 부탁드릴께요.

프로필 이미지
하루4%
2016-10-25 14:34:03
116
글번호 103323
답변완료

첨부 이미지

안녕하세요~ 수정을 부탁드렸는데 수정해주신 결과물이 똑같이 나오네요.. 수정해주신 수식은 if MarketPosition == 0 and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if MarketPosition == 1 Then{ if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MaxEntries < 3 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries < 3 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); #5% 수익시 절반매도 ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } else{ Condition1 = false; } 입니다 "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 "매수1" "매수2" "추매" 금지. 이렇게 인데요. 여전히 "절반" 매도후 "매수1" "추매" "매수2" 가 다 됩니다.. 다시 수정 부탁드립니다. 아 그리고 다시 매도 조건을 추가드리면요~ "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "추매" 나 "매수2" 둘중 하나가 나오면 추가매수 금지. 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 재매수 및 추가매수 금지. 피라미딩 다른진입신호만 허용에 체크 했습니다. 절반매도일 경우 혹시 나머지 매도 과정에서 단주가 남으면 어떻게 되나요? 꼭 좀 부탁드리겠습니다 감사합니다.
시스템
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2016-10-25 16:36:47

안녕하세요 예스스탁입니다. 1 매수1로 매수진입후 추가진입은 매수2나 추매 중 하나로만 한번만 발생하게 수정했습니다. 2 하나의 exitlong 함수가 진입신호횟수만큼 발동합니다 절반 청산은 매수진행중 한번만 발동하게 했습니다. 3 매수청산신호가 한번이상 발생하면 모든 매수진입은 당일 발생하지 않게 했습니다. 4 청산식에 수량을 지정하지 않으면 자동으로 전량청산입니다. "절반"청산을 제외한 나머지 청산은 수량이 지정되어 있지 않아 남은수량에 대한 전량 청산하므로 단주가 남을 수 없습니다. 5 수정한 식입니다. var : Xcond1(false); if bdate != bdate[1] Then Condition1 = false; if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 즐거운 하루되세요 > 하루4% 님이 쓴 글입니다. > 제목 : 수정 부탁드릴께요. > 안녕하세요~ 수정을 부탁드렸는데 수정해주신 결과물이 똑같이 나오네요.. 수정해주신 수식은 if MarketPosition == 0 and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if MarketPosition == 1 Then{ if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MaxEntries < 3 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries < 3 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); #5% 수익시 절반매도 ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } else{ Condition1 = false; } 입니다 "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 "매수1" "매수2" "추매" 금지. 이렇게 인데요. 여전히 "절반" 매도후 "매수1" "추매" "매수2" 가 다 됩니다.. 다시 수정 부탁드립니다. 아 그리고 다시 매도 조건을 추가드리면요~ "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "추매" 나 "매수2" 둘중 하나가 나오면 추가매수 금지. 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 재매수 및 추가매수 금지. 피라미딩 다른진입신호만 허용에 체크 했습니다. 절반매도일 경우 혹시 나머지 매도 과정에서 단주가 남으면 어떻게 되나요? 꼭 좀 부탁드리겠습니다 감사합니다.
프로필 이미지

하루4%

2016-10-25 17:21:05

이 수식이 맞는지요~ if bdate != bdate[1] Then{ MM[0] =0; for cnt = 1 to 49{ MM[cnt] = MM[cnt-1][1]; } Condition1 = false; } MM[0] = MM[0]+M; sum = 0; for cnt = 1 to 14{ sum = sum+MM[cnt]; } M1 = sum/14; V1 = 0; for cnt = 1 to 30{ if DayClose(cnt) >= DayClose(cnt+1)*1.15 Then V1 = V1+1; } if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 처음 매수1 후 매수2 추매 도 다 매수가 됩니다.. 매수청산신호가 한번이상 발생하면 모든 매수진입은 당일 발생하지는 않습니다~ 감사합니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수정 부탁드릴께요. > 안녕하세요 예스스탁입니다. 1 매수1로 매수진입후 추가진입은 매수2나 추매 중 하나로만 한번만 발생하게 수정했습니다. 2 하나의 exitlong 함수가 진입신호횟수만큼 발동합니다 절반 청산은 매수진행중 한번만 발동하게 했습니다. 3 매수청산신호가 한번이상 발생하면 모든 매수진입은 당일 발생하지 않게 했습니다. 4 청산식에 수량을 지정하지 않으면 자동으로 전량청산입니다. "절반"청산을 제외한 나머지 청산은 수량이 지정되어 있지 않아 남은수량에 대한 전량 청산하므로 단주가 남을 수 없습니다. 5 수정한 식입니다. var : Xcond1(false); if bdate != bdate[1] Then Condition1 = false; if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 즐거운 하루되세요 > 하루4% 님이 쓴 글입니다. > 제목 : 수정 부탁드릴께요. > 안녕하세요~ 수정을 부탁드렸는데 수정해주신 결과물이 똑같이 나오네요.. 수정해주신 수식은 if MarketPosition == 0 and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if MarketPosition == 1 Then{ if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MaxEntries < 3 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries < 3 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); #5% 수익시 절반매도 ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } else{ Condition1 = false; } 입니다 "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 "매수1" "매수2" "추매" 금지. 이렇게 인데요. 여전히 "절반" 매도후 "매수1" "추매" "매수2" 가 다 됩니다.. 다시 수정 부탁드립니다. 아 그리고 다시 매도 조건을 추가드리면요~ "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "추매" 나 "매수2" 둘중 하나가 나오면 추가매수 금지. 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 재매수 및 추가매수 금지. 피라미딩 다른진입신호만 허용에 체크 했습니다. 절반매도일 경우 혹시 나머지 매도 과정에서 단주가 남으면 어떻게 되나요? 꼭 좀 부탁드리겠습니다 감사합니다.
프로필 이미지

예스스탁 예스스탁 답변

2016-10-25 17:20:42

> 하루4% 님이 쓴 글입니다. > 제목 : Re : Re : 수정 부탁드릴께요. > 이 수식이 맞는지요~ if bdate != bdate[1] Then{ MM[0] =0; for cnt = 1 to 49{ MM[cnt] = MM[cnt-1][1]; } Condition1 = false; } MM[0] = MM[0]+M; sum = 0; for cnt = 1 to 14{ sum = sum+MM[cnt]; } M1 = sum/14; V1 = 0; for cnt = 1 to 30{ if DayClose(cnt) >= DayClose(cnt+1)*1.15 Then V1 = V1+1; } if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 매수1 후 매수2 추매 도 다 매수가 됩니다.. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수정 부탁드릴께요. > 안녕하세요 예스스탁입니다. 1 매수1로 매수진입후 추가진입은 매수2나 추매 중 하나로만 한번만 발생하게 수정했습니다. 2 하나의 exitlong 함수가 진입신호횟수만큼 발동합니다 절반 청산은 매수진행중 한번만 발동하게 했습니다. 3 매수청산신호가 한번이상 발생하면 모든 매수진입은 당일 발생하지 않게 했습니다. 4 청산식에 수량을 지정하지 않으면 자동으로 전량청산입니다. "절반"청산을 제외한 나머지 청산은 수량이 지정되어 있지 않아 남은수량에 대한 전량 청산하므로 단주가 남을 수 없습니다. 5 수정한 식입니다. var : Xcond1(false); if bdate != bdate[1] Then Condition1 = false; if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 즐거운 하루되세요 > 하루4% 님이 쓴 글입니다. > 제목 : 수정 부탁드릴께요. > 안녕하세요~ 수정을 부탁드렸는데 수정해주신 결과물이 똑같이 나오네요.. 수정해주신 수식은 if MarketPosition == 0 and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if MarketPosition == 1 Then{ if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MaxEntries < 3 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries < 3 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); #5% 수익시 절반매도 ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } else{ Condition1 = false; } 입니다 "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 "매수1" "매수2" "추매" 금지. 이렇게 인데요. 여전히 "절반" 매도후 "매수1" "추매" "매수2" 가 다 됩니다.. 다시 수정 부탁드립니다. 아 그리고 다시 매도 조건을 추가드리면요~ "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "추매" 나 "매수2" 둘중 하나가 나오면 추가매수 금지. 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 재매수 및 추가매수 금지. 피라미딩 다른진입신호만 허용에 체크 했습니다. 절반매도일 경우 혹시 나머지 매도 과정에서 단주가 남으면 어떻게 되나요? 꼭 좀 부탁드리겠습니다 감사합니다.
프로필 이미지

하루4%

2016-10-25 17:57:27

감사합니다 해결했습니다~ ^^ 좋은시간되세요~ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 전화주시기 바랍니다(02-3453-1060) > > 하루4% 님이 쓴 글입니다. > 제목 : Re : Re : 수정 부탁드릴께요. > 이 수식이 맞는지요~ if bdate != bdate[1] Then{ MM[0] =0; for cnt = 1 to 49{ MM[cnt] = MM[cnt-1][1]; } Condition1 = false; } MM[0] = MM[0]+M; sum = 0; for cnt = 1 to 14{ sum = sum+MM[cnt]; } M1 = sum/14; V1 = 0; for cnt = 1 to 30{ if DayClose(cnt) >= DayClose(cnt+1)*1.15 Then V1 = V1+1; } if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 매수1 후 매수2 추매 도 다 매수가 됩니다.. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수정 부탁드릴께요. > 안녕하세요 예스스탁입니다. 1 매수1로 매수진입후 추가진입은 매수2나 추매 중 하나로만 한번만 발생하게 수정했습니다. 2 하나의 exitlong 함수가 진입신호횟수만큼 발동합니다 절반 청산은 매수진행중 한번만 발동하게 했습니다. 3 매수청산신호가 한번이상 발생하면 모든 매수진입은 당일 발생하지 않게 했습니다. 4 청산식에 수량을 지정하지 않으면 자동으로 전량청산입니다. "절반"청산을 제외한 나머지 청산은 수량이 지정되어 있지 않아 남은수량에 대한 전량 청산하므로 단주가 남을 수 없습니다. 5 수정한 식입니다. var : Xcond1(false); if bdate != bdate[1] Then Condition1 = false; if MarketPosition == 0 and Condition1 == false and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MarketPosition == 1 Then{ if MaxEntries == 1 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries == 1 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "절반" Then Xcond1 = true; #5% 수익시 절반매도 if Xcond1 == false Then ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } Else Xcond1 = false; 즐거운 하루되세요 > 하루4% 님이 쓴 글입니다. > 제목 : 수정 부탁드릴께요. > 안녕하세요~ 수정을 부탁드렸는데 수정해주신 결과물이 똑같이 나오네요.. 수정해주신 수식은 if MarketPosition == 0 and V1 >= 1 and M1 >= 5000000000 and MM[14] > 0 and (mav3*1.14 <= mav2 or maV31*1.14 <= maV21) and maV3 < L and maV1 < mav11 and ((mav2*0.995 <= mav1 and mav2*1.075 >= mav1) or (maV21*0.995 <= maV11 and maV21*1.075 >= maV11) or (mav11 > mav21 and maV2 >= maV1)) and !(maV21 > mav2 and maV22 > mav21) and L > mav9*1.002 Then buy("매수1",atlimit,mav9*1.002); if MarketPosition == 1 Then{ if CurrentContracts < CurrentContracts[1] Then Condition1 = true; if MaxEntries < 3 and Condition1 == false and L > maV3*1.02 Then buy("매수2",atlimit,maV3*1.02 ); if MaxEntries < 3 and Condition1 == false Then buy("추매",atlimit,EntryPrice*0.95); #5% 수익시 절반매도 ExitLong("절반",atlimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1); #10% 수익시 나머지수량 전량매도 ExitLong("전량",atlimit,EntryPrice*1.10); #-1% 아래에서 상승해 위로 터치하면 매도 if H < mav7*0.998 Then ExitLong("3일매도",atlimit,mav7*0.998); if H < mav1*0.995 Then ExitLong("5일매도",atlimit,mav1*0.995); if L > mav3*0.98 Then ExitLong("20일손절",AtStop,mav3*0.98); } else{ Condition1 = false; } 입니다 "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 "매수1" "매수2" "추매" 금지. 이렇게 인데요. 여전히 "절반" 매도후 "매수1" "추매" "매수2" 가 다 됩니다.. 다시 수정 부탁드립니다. 아 그리고 다시 매도 조건을 추가드리면요~ "매수1" 매수후 또 maV3*1.02 에 크로스다운이 되면 "매수2"로 추가 매수 . 손실 -5%가 &#46124;을때 "추매"로 추가매수 당일 "추매" 나 "매수2" 둘중 하나가 나오면 추가매수 금지. 당일 "절반" "3일매도" "5일매도" "20일손절" 이 나오면 재매수 및 추가매수 금지. 피라미딩 다른진입신호만 허용에 체크 했습니다. 절반매도일 경우 혹시 나머지 매도 과정에서 단주가 남으면 어떻게 되나요? 꼭 좀 부탁드리겠습니다 감사합니다.