커뮤니티

시스템식에 대해 문의드립니다.

프로필 이미지
kosto1
2016-06-20 22:22:08
205
글번호 99274
답변완료
안녕하세요~ 수정해 주신 식을 바탕으로 테스트를 해보고 있습니다. 원하는 신호가 안나오는 부분이 있어 제가 빠뜨린 것이 있는지 해서 문의드립니다. 종목명 : 우수ams A. 신고가 조건 성립 120일 신고가 돌파 AND 지난 30일 동안 거래대금 중 최고 거래대금 AND O *1.03 > C B. 5월 2일 1차 매수 C. 5월 11일 근처에 매도 A B C 에 대한 신호가 나와야 하는데 나오질 않습니다. 어떤 부분이 때문인지 수정 부탁드립니다. ---------------------------------------------------------------------------- 시스템식은 다음과 같습니다. input : P(120),MP(30),Period(10),per(10),시작날짜(20160101),매수1차(1000000),매수2차(1500000),매수3차(2000000); var : kk(0),V0.5(0),V1(0),V2(0),V3(0); var : V4(0),ss(0),s1(0),dayhh(0),cnt(0),ll(0); var : entry(false),Price1(0),Price2(0),Price3(0); var : MMH(0),Eup(0),Edn(0),nn(0); Array : MM[50](0); if date != date[1] Then{ MM[0] = 0; for cnt = 1 to 49{ MM[cnt] = MM[cnt-1][1]; } } MM[0] = MM[0]+M; dayhh = dayhigh(0); for cnt = 0 to P-1{ if dayhigh(cnt) > dayhh Then dayhh = dayhigh(cnt); } #MP일간 거대래금 최고 MMH = MM[1]; for cnt = 1 to MP{ if MM[cnt] > MMH Then MMH = MM[cnt]; } Eup = EnvelopeUp(Period,per); Edn = EnvelopeUp(Period,per); ##### 신고가 조건 ############ if sdate >= 시작날짜 and MM[MP] > 0 then{ if dayhh > dayhh[1] and MM[0] > MMH and O*1.03 < c Then{ Condition1 = true; entry=true; LL = L; nn = money; } # 지표 설정식 ## if condition1 ==true then { #신고가 이후 최저가 if L < LL Then LL = L; #지표# var1 = highest(h,p); var2 = lowest(L,p); if var1[1] < var1 Then kk = (var1+var2)/2; V0.5 = var1-((var1-kk)/5)*1; V1 = var1-((var1-kk)/5)*2; V2 = var1-((var1-kk)/5)*3; V3 = var1-((var1-kk)/5)*4; V4 = var1-((var1-kk)/5)*5; #매도폭 ss = v2-v3 ; Price1 = v2; Price2 = v3; Price3 = v4; } } if MarketPosition == 1 Then entry = false; #가격이 하락해 1차매수가격 이하이면 매수 if MarketPosition == 0 and condition1 == true and entry == true and LL > Price1 Then buy("b1",atlimit,Price1,Floor(매수1차/C)); #가격이 하락해 2차매수가격 이하이면 매수 if MarketPosition == 1 and MaxEntries == 1 and Price2 > 0 Then buy("b2",atlimit,Price2,Floor(매수2차/C)); #가격이 하락해 3차매수가격 이하이면 매수 if MarketPosition == 1 and MaxEntries == 2 and Price3 > 0 Then buy("b3",atlimit,Price3,Floor(매수3차/C)); if MarketPosition == 1 Then{ #진입이후 최저가에서 폭만큼 상승하면 청산 ExitLong("bx1",atlimit,lowest(L,BarsSinceEntry)+ss); if MaxEntries == 2 Then exitlong("본절2",atlimit,(Price1+Price2)/2); if MaxEntries == 3 Then exitlong("본절3",atlimit,Price2); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-06-20 17:52:58

안녕하세요 예스스탁입니다. 현재 첫진입식의 조건에 LL > Price1라는 조건이 있습니다. LL은 신고가이후의 최저가인데 이값이 price1보다 클때만 진입하게 되어 있는데 아래 지표 적용해 보시면 price보다 작습니다.(A봉의 저가) LL > Price조건은 Price1을 한번이상 하향한후 다시 올라갔다가 하향할때 진입을 막는 역할인데 다른방법으로 제어하게 수정해 드립니다. input : P(120),MP(30),Period(10),per(10),시작날짜(20160101),매수1차(1000000),매수2차(1500000),매수3차(2000000); var : kk(0),V0.5(0),V1(0),V2(0),V3(0); var : V4(0),ss(0),s1(0),dayhh(0),cnt(0),ll(0); var : entry(false),Price1(0),Price2(0),Price3(0); var : MMH(0),Eup(0),Edn(0),nn(0),P1cond(false),ii(0); Array : MM[50](0); if date != date[1] Then{ MM[0] = 0; for cnt = 1 to 49{ MM[cnt] = MM[cnt-1][1]; } } MM[0] = MM[0]+M; dayhh = dayhigh(0); for cnt = 0 to P-1{ if dayhigh(cnt) > dayhh Then dayhh = dayhigh(cnt); } #MP일간 거대래금 최고 MMH = MM[1]; for cnt = 1 to MP{ if MM[cnt] > MMH Then MMH = MM[cnt]; } Eup = EnvelopeUp(Period,per); Edn = EnvelopeUp(Period,per); ##### 신고가 조건 ############ if sdate >= 시작날짜 and MM[MP] > 0 then{ if dayhh > dayhh[1] and MM[0] > MMH and O*1.03 < c Then{ Condition1 = true; entry = true; LL = L; nn = money; P1cond = true; ii = index; } # 지표 설정식 ## if condition1 ==true then { #신고가 이후 최저가 if L < LL Then LL = L; #지표# var1 = highest(h,p); var2 = lowest(L,p); if var1[1] < var1 Then kk = (var1+var2)/2; V0.5 = var1-((var1-kk)/5)*1; V1 = var1-((var1-kk)/5)*2; V2 = var1-((var1-kk)/5)*3; V3 = var1-((var1-kk)/5)*4; V4 = var1-((var1-kk)/5)*5; #매도폭 ss = v2-v3 ; Price1 = v2; Price2 = v3; Price3 = v4; if index> ii and L <= price1 Then P1cond = false; } } if MarketPosition == 1 Then entry = false; #가격이 하락해 1차매수가격 이하이면 매수 if MarketPosition == 0 and condition1 == true and entry == true and P1cond == true Then buy("b1",atlimit,Price1,Floor(매수1차/C)); #가격이 하락해 2차매수가격 이하이면 매수 if MarketPosition == 1 and MaxEntries == 1 and Price2 > 0 Then buy("b2",atlimit,Price2,Floor(매수2차/C)); #가격이 하락해 3차매수가격 이하이면 매수 if MarketPosition == 1 and MaxEntries == 2 and Price3 > 0 Then buy("b3",atlimit,Price3,Floor(매수3차/C)); if MarketPosition == 1 Then{ #진입이후 최저가에서 폭만큼 상승하면 청산 ExitLong("bx1",atlimit,lowest(L,BarsSinceEntry)+ss); if MaxEntries == 2 Then exitlong("본절2",atlimit,(Price1+Price2)/2); if MaxEntries == 3 Then exitlong("본절3",atlimit,Price2); } 즐거운 하루되세요 > kosto1 님이 쓴 글입니다. > 제목 : 시스템식에 대해 문의드립니다. > 안녕하세요~ 수정해 주신 식을 바탕으로 테스트를 해보고 있습니다. 원하는 신호가 안나오는 부분이 있어 제가 빠뜨린 것이 있는지 해서 문의드립니다. 종목명 : 우수ams A. 신고가 조건 성립 120일 신고가 돌파 AND 지난 30일 동안 거래대금 중 최고 거래대금 AND O *1.03 > C B. 5월 2일 1차 매수 C. 5월 11일 근처에 매도 A B C 에 대한 신호가 나와야 하는데 나오질 않습니다. 어떤 부분이 때문인지 수정 부탁드립니다. ---------------------------------------------------------------------------- 시스템식은 다음과 같습니다. input : P(120),MP(30),Period(10),per(10),시작날짜(20160101),매수1차(1000000),매수2차(1500000),매수3차(2000000); var : kk(0),V0.5(0),V1(0),V2(0),V3(0); var : V4(0),ss(0),s1(0),dayhh(0),cnt(0),ll(0); var : entry(false),Price1(0),Price2(0),Price3(0); var : MMH(0),Eup(0),Edn(0),nn(0); Array : MM[50](0); if date != date[1] Then{ MM[0] = 0; for cnt = 1 to 49{ MM[cnt] = MM[cnt-1][1]; } } MM[0] = MM[0]+M; dayhh = dayhigh(0); for cnt = 0 to P-1{ if dayhigh(cnt) > dayhh Then dayhh = dayhigh(cnt); } #MP일간 거대래금 최고 MMH = MM[1]; for cnt = 1 to MP{ if MM[cnt] > MMH Then MMH = MM[cnt]; } Eup = EnvelopeUp(Period,per); Edn = EnvelopeUp(Period,per); ##### 신고가 조건 ############ if sdate >= 시작날짜 and MM[MP] > 0 then{ if dayhh > dayhh[1] and MM[0] > MMH and O*1.03 < c Then{ Condition1 = true; entry=true; LL = L; nn = money; } # 지표 설정식 ## if condition1 ==true then { #신고가 이후 최저가 if L < LL Then LL = L; #지표# var1 = highest(h,p); var2 = lowest(L,p); if var1[1] < var1 Then kk = (var1+var2)/2; V0.5 = var1-((var1-kk)/5)*1; V1 = var1-((var1-kk)/5)*2; V2 = var1-((var1-kk)/5)*3; V3 = var1-((var1-kk)/5)*4; V4 = var1-((var1-kk)/5)*5; #매도폭 ss = v2-v3 ; Price1 = v2; Price2 = v3; Price3 = v4; } } if MarketPosition == 1 Then entry = false; #가격이 하락해 1차매수가격 이하이면 매수 if MarketPosition == 0 and condition1 == true and entry == true and LL > Price1 Then buy("b1",atlimit,Price1,Floor(매수1차/C)); #가격이 하락해 2차매수가격 이하이면 매수 if MarketPosition == 1 and MaxEntries == 1 and Price2 > 0 Then buy("b2",atlimit,Price2,Floor(매수2차/C)); #가격이 하락해 3차매수가격 이하이면 매수 if MarketPosition == 1 and MaxEntries == 2 and Price3 > 0 Then buy("b3",atlimit,Price3,Floor(매수3차/C)); if MarketPosition == 1 Then{ #진입이후 최저가에서 폭만큼 상승하면 청산 ExitLong("bx1",atlimit,lowest(L,BarsSinceEntry)+ss); if MaxEntries == 2 Then exitlong("본절2",atlimit,(Price1+Price2)/2); if MaxEntries == 3 Then exitlong("본절3",atlimit,Price2); }