커뮤니티

최소변화청산1

프로필 이미지
목마와숙녀
2021-12-16 11:24:28
685
글번호 153513
답변완료
코스피200선물 5분봉차트에서 1개만 사용하던 최소변화 수식을 아래처럼 3개의 시간대로 나누어 사용해보았는데...시뮬레이션이 되더군요. 12시건 시뮬레이션 후 거래내역 s1오케이 13시건 시뮬레이션 후 거래내역 s2 오케이 14시건 시뮬레이션 후 거래내역 s3 오케이 거래내역을 보면 s1,s2,s3 모두 존재합니다. 그런데, 역으로 접근했을 때에는 문제가 발생합니다. 14시건 시뮬레이션 후 거래내역 s3 오케이 13시건 시뮬레이션 후 거래내역 s2 오케이...그런데 이 때 거래내역 s3이 없어집니다. 5분봉이니까 봉맥스는 12개까지 했고요. 봉맥스를 넘지 않는다면 시간대별로 구분되는 수식을 원합니다. 그렇다면 시간순으로 하던지 역으로 하던지 같은 결과가 나올 겁니다 아무래도 수식을 무리하게 나눈 것이 문제인 것 같으니 수정바랍니다. ********************************************************************************* var : hh(0),ll(0),ii(0); input : dnHLtime1(120000),dnbar1(12),dnHLrange1(1.00); input : dnHLtime2(130000),dnbar2(12),dnHLrange2(1.00); input : dnHLtime3(140000),dnbar3(12),dnHLrange3(1.00); if bdate != bdate[1] Then { hh = 0; ll = 0; ii = 0; } if stime >= dnHLtime1 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar1 and hh-ll < dnHLrange1 Then ExitShort("s1최소변화"); } if stime >= dnHLtime2 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar2 and hh-ll < dnHLrange2 Then ExitShort("s2최소변화"); } if stime >= dnHLtime3 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar3 and hh-ll < dnHLrange3 Then ExitShort("s3최소변화"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-11-10 16:21:08

안녕하세요 예스스탁입니다. input : dnHLtime1(120000),dnbar1(12),dnHLrange1(1.00); input : dnHLtime2(130000),dnbar2(12),dnHLrange2(1.00); input : dnHLtime3(140000),dnbar3(12),dnHLrange3(1.00); var : tt(0),hh(0),ll(0),ii(0); if bdate != bdate[1] Then { tt = 0; hh = 0; ll = 0; ii = 0; } if (sdate != sdate[1] and stime >= dnHLtime1) or (sdate == sdate[1] and stime >= dnHLtime1 and stime[1] < dnHLtime1) Then { tt = 1; hh = 0; ll = 0; ii = 0; } if (sdate != sdate[1] and stime >= dnHLtime2) or (sdate == sdate[1] and stime >= dnHLtime2 and stime[1] < dnHLtime2) Then { tt = 2; hh = 0; ll = 0; ii = 0; } if (sdate != sdate[1] and stime >= dnHLtime3) or (sdate == sdate[1] and stime >= dnHLtime3 and stime[1] < dnHLtime3) Then { tt = 3; hh = 0; ll = 0; ii = 0; } if tt == 1 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar1 and hh-ll < dnHLrange1 Then ExitShort("s1최소변화"); } if tt == 2 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar2 and hh-ll < dnHLrange2 Then ExitShort("s2최소변화"); } if tt == 3 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar3 and hh-ll < dnHLrange3 Then ExitShort("s3최소변화"); } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > 코스피200선물 5분봉차트에서 1개만 사용하던 최소변화 수식을 아래처럼 3개의 시간대로 나누어 사용해보았는데...시뮬레이션이 되더군요. 12시건 시뮬레이션 후 거래내역 s1오케이 13시건 시뮬레이션 후 거래내역 s2 오케이 14시건 시뮬레이션 후 거래내역 s3 오케이 거래내역을 보면 s1,s2,s3 모두 존재합니다. 그런데, 역으로 접근했을 때에는 문제가 발생합니다. 14시건 시뮬레이션 후 거래내역 s3 오케이 13시건 시뮬레이션 후 거래내역 s2 오케이...그런데 이 때 거래내역 s3이 없어집니다. 5분봉이니까 봉맥스는 12개까지 했고요. 봉맥스를 넘지 않는다면 시간대별로 구분되는 수식을 원합니다. 그렇다면 시간순으로 하던지 역으로 하던지 같은 결과가 나올 겁니다 아무래도 수식을 무리하게 나눈 것이 문제인 것 같으니 수정바랍니다. ********************************************************************************* var : hh(0),ll(0),ii(0); input : dnHLtime1(120000),dnbar1(12),dnHLrange1(1.00); input : dnHLtime2(130000),dnbar2(12),dnHLrange2(1.00); input : dnHLtime3(140000),dnbar3(12),dnHLrange3(1.00); if bdate != bdate[1] Then { hh = 0; ll = 0; ii = 0; } if stime >= dnHLtime1 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar1 and hh-ll < dnHLrange1 Then ExitShort("s1최소변화"); } if stime >= dnHLtime2 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar2 and hh-ll < dnHLrange2 Then ExitShort("s2최소변화"); } if stime >= dnHLtime3 then { ii = ii +1; if hh == 0 or (hh > 0 and h > hh) Then hh = h; if ll == 0 or (ll > 0 and l < ll) Then ll = l; if ii >= dnbar3 and hh-ll < dnHLrange3 Then ExitShort("s3최소변화"); }