커뮤니티

수식요청드립니다

프로필 이미지
dandy
2016-03-24 02:32:20
138
글번호 96544
답변완료
안녕하세요. 수정해주신 아래수식을 틱봉차트에 적용 목표수익, 이평을 축소 하여도 청산신호가 나오지 안네요. (목표수익은 피라미딩 진입포함 총합산수익으로 적용해주세요.) 점검 요청 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식요청드립니다. > 안녕하세요 예스스탁입니다. 식을 수정했습니다. 가격은 최근진입이후의 최고가를 쓰는데 지수이평의 최고가는 첫진입이후 최고그를 사용했습니다. 지수이평도 최근 진입이후 최고가 대비로 변경했습니다. var : emav(0),HH(0),LL(0),HI(0),Li(0); emav = ema(C,20); if MarketPosition == 1 Then{ #매수후 이평이 하락하면 true if emav < emav[1] Then Condition1 = true; #최근 진입이후 최고가외 지수이평 최고가 계산 if CurrentContracts > CurrentContracts[1] Then{ HH = H; HI = emav; } if H > HH Then HH = H; if emav > HI Then HI = emav; #매수이후 지수이평하락이 한번도 없었고(Condition1이 아직 false) #최근 진입이후 최고가가 평단가 대비 3포인트 이상 크면 #Condition1은 true if Condition1 == false and H == HH and HH >= AvgEntryPrice+3 Then Condition11 = true; #Condition11이 true이고 #지수이평이 최근진입이후 이평최고가대비 10% 이하일때 if Condition11 == true and emav <= HI*0.90 Then exitlong(); } Else{ Condition1 = false; Condition11 = false; } if MarketPosition == -1 Then{ if emav > emav[1] Then Condition2 = true; if CurrentContracts > CurrentContracts[1] Then{ LL = L; LI = emav; } if L < LL Then LL = L; if emav < LI Then LI = emav; if Condition2 == false and L == LL and LL <= AvgEntryPrice-3 Then Condition22 = true; if Condition22 == false and emav >= LI*1.10 Then ExitShort(); } Else{ Condition2 = false; Condition22 = false; } 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식요청드립니다. > 안녕하세요. 작성해주신 아래수식을 기본진입수식에 적용 목표수익을 줄여도 청산이 잘안되네요. 점검 요청 드립니다. //********************************************************************************** #기본진입수식 Inputs: DMILen(14), Consec(3), MinDiff(0); Variables: DMIDiff(0); DMIDiff = DIPlus(DMILen) - DIMinus(DMILen); If DMIDiff[Consec] > 0 Then Begin If DMIDiff >= MinDiff AND CountIF(DMIDiff > DMIDiff[1], Consec) == Consec Then Buy ("DMI_LE"); End; If DMIDiff[Consec] < 0 Then Begin If Abs(DMIDiff) >= MinDiff AND CountIF(DMIDiff < DMIDiff[1], Consec) == Consec Then Sell ("DMI_SE"); End; //---------------------------------------------------------------------------------- #피라미딩진입수식 input : i증감(0.3),누적진입횟수(3),진입수량(1); if MarketPosition == 1 and MaxEntries < 누적진입횟수 Then Buy("PBB",AtStop,LatestEntryPrice(0)+i증감,진입수량); if MarketPosition == -1 and MaxEntries < 누적진입횟수 Then sell("PSS",AtStop,LatestEntryPrice(0)-i증감,진입수량); //================================================================================== #청산수식 var : emav(0),HH(0),LL(0); emav = ema(C,10); if MarketPosition == 1 Then{ if emav < emav[1] Then Condition1 = true; if CurrentContracts > CurrentContracts[1] Then HH = H; if H > HH Then HH = H; if Condition1 == true and H == HH and HH >= AvgEntryPrice+1 Then//목표수익3PT Condition11 = true; if Condition11 == true and emav <= highest(emav,BarsSinceEntry)*0.90 Then exitlong("매수청산"); } Else{ Condition1 = false; Condition11 = false; } if MarketPosition == -1 Then{ if emav > emav[1] Then Condition2 = true; if CurrentContracts > CurrentContracts[1] Then LL = L; if L < LL Then LL = L; if Condition2 == true and L == LL and LL <= AvgEntryPrice-1 Then//목표수익3PT Condition22 = true; if Condition22 == false and emav >= Lowest(emav,BarsSinceEntry)*1.10 Then ExitShort("매도청산"); } Else{ Condition2 = false; Condition22 = false; } //============================================================================ #선물만기일이면 14시45분 청산, 아니면 15시 청산 var: month(0),nday(0),week(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; week = DayOfWeek(date); if month%3 == 0 and nday >= 8 and nday <= 14 and week == 4 then SetStopEndofday(144500); Else SetStopEndofday(150000); //============================================================================ 안녕하세요 예스스탁입니다. var : emav(0),HH(0),LL(0); emav = ema(C,20); if MarketPosition == 1 Then{ if emav < emav[1] Then Condition1 = true; if CurrentContracts > CurrentContracts[1] Then HH = H; if H > HH Then HH = H; if Condition1 == true and H == HH and HH >= AvgEntryPrice+3 Then Condition11 = true; if Condition11 == true and emav <= highest(emav,BarsSinceEntry)*0.90 Then exitlong(); } Else{ Condition1 = false; Condition11 = false; } if MarketPosition == -1 Then{ if emav > emav[1] Then Condition2 = true; if CurrentContracts > CurrentContracts[1] Then LL = L; if L < LL Then LL = L; if Condition2 == true and L == LL and LL <= AvgEntryPrice-3 Then Condition22 = true; if Condition22 == false and emav >= Lowest(emav,BarsSinceEntry)*1.10 Then ExitShort(); } Else{ Condition2 = false; Condition22 = false; } 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식요청드립니다. > 안녕하세요. 당일청산 피라미딩 시스템에서 매도, 매수 포지션 진입 후 목표수익달성, 지수이평선 기울기 각도, 현재봉의 종가에 수익청산 시스템 수식 요청드립니다. << 청산조건 3가지 필수 청산조건 >> -> 매수진입 후 20 지수이평선 기울기 각도가 계속상승 조건발생(반대로 하락시 수식적용 제외) 1. 3PT 이상 목표수익 발생 후 2. 목표수익 발생 후, 고점에서 20 지수이평선 기울기 10%(또는 10도) 하락하고 3. 고점에서 20 지수이평선 기울기 각도가 상승, 횡보, 10%(또는 10도) 하락 시 현재봉의 종가에 수익청산 -> 매도진입 후 20 지수이평선 기울기 각도가 계속하락 조건발생(반대로 상승시 수식적용 제외) 1. 3PT 이상 목표수익 발생 후 2. 목표수익 발생 후, 저점에서 20 지수이평선 기울기 10%(또는 10도) 상승하고 3. 저점에서 20 지수이평선 기울기 각도가 상승, 횡보, 10%(또는 10도) 상승시 현재봉의 종가에 수익청산 ( 이평선 기울기는 %와 각도 중 이평선 기울기 판단에 유리한 조건으로 적용해 주세요) 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-03-24 10:08:47

안녕하세요 예스스탁입니다. input : 합산손익(3),이평증감폭(1.5); var : emav(0),HH(0),LL(0),HI(0),Li(0); emav = ema(C,20); if MarketPosition == 1 Then{ if MarketPosition[1] != 1 or (BarsSinceEntry >= 1 and CurrentContracts > CurrentContracts[1]) Then{ HI = emav; Condition1 = false; } if emav > HI Then HI = emav; if PositionProfit >= 합산손익 Then Condition1 = true; if Condition1 == true and emav <= HI-이평증감폭 Then exitlong("bx"); } Else Condition1 = false; if MarketPosition == -1 Then{ if MarketPosition[1] != -1 or (BarsSinceEntry >= 1 and CurrentContracts > CurrentContracts[1]) Then{ LL = L; LI = emav; Condition2 = false; } if L < LL Then LL = L; if emav < LI Then LI = emav; if PositionProfit >= 3 Then Condition2 = true; if Condition2 == false and emav >= LI+이평증감폭 Then ExitShort("sx"); } Else Condition2 = false; 즐거운 하루되세요