커뮤니티

문의드립니다~

프로필 이미지
겐지
2019-03-04 18:39:00
257
글번호 126695
답변완료

첨부 이미지

input : 분주기(30),P(5),분주기1(15),분주기2(5); var : S1(0),D1(0),TM(0),TF(0); var : cnt(0),sum(0),mav(0),tf1(0),TFF(0),entry(false),tf2(0); Array : CC[100](0),OO[100](0),HH[100](0),LL[100](0),TT[100](0),ii[100](0),O2[100](0); Array : C1[100](0),T1[100](0); if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) Then{ S1 = TimeToMinutes(100000); D1 = sdate; } if D1 > 0 then{ if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TFF = TM%60; TF = TM%분주기; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or (TF < TF[1]) Then{ OO[0] = o; HH[0] = H; LL[0] = L; TT[0] = stime; ii[0] = 0; for cnt = 1 to 99{ OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; TT[cnt] = TT[cnt-1][1]; ii[cnt] = ii[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; ii[0] = ii[0]+1; TF1 = TM%분주기1; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or (TF1 < TF1[1]) Then{ T1[0] = stime; for cnt = 1 to 99{ C1[cnt] = C1[cnt-1][1]; T1[cnt] = T1[cnt-1][1]; } } C1[0] = C; TF2 = TM%분주기2; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or (TF2 < TF2[1]) Then{ O2[0] = o; for cnt = 1 to 99{ O2[cnt] = O2[cnt-1][1]; } } entry = true; if (stime >= 10000 and stime < 45000) and ii[1]+ii[2] < 30 Then entry = false; if stime >= 120000 and stime < 165000 and ii[1]+ii[2] < 45 Then entry = false; var75 = highest(H,250); var76 = Lowest(L,250); if (stime >= 111500 and stime < 165000) and var75 <= var76+PriceScale*60 Then entry = false; } var2 = (c+cc[1]+cc[2]+cc[3]+cc[4])/5 ; Plot1(var2); 질문: 항생에서 30분봉5일선을 구해서 사용하고 있습니다.~ 그런데 30분봉5일선가격이 맞지않아서 계산해 보니깐 계산대로는 오전10시15분에 오픈하고나면은 오픈시간의 5일선가격이 10시15분가격과 그리고 이전종가인 전일의1시30분가격이 더해지고 그리고 그 전의 종가가 더해져서 30분봉 5일선가격이 정해져야되는데 바로이전가격이 10시가격이 되어서 더해지는 문제가 있습니다.~ 즉 10시15분에 오픈하면 10시15분과 그리고 이전종가가 10시가격으로 적용되어서 이중으로더해져서 계산이 됩니다. S1 = TimeToMinutes(100000); 이부분을 S1 = TimeToMinutes(101500); 이렇게 바꿔서 적용해보니깐 제대로 되는데 30분단위로 계산이 안되고 15분45분이렇게 계산이 되네요~ 10시15분오픈하면은 10시15분과 전일1시30분으로 계산이 되고 이후로는 10시30분부터 되도록 식 수정좀 부탁드릴게요~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-03-05 16:41:50

안녕하세요 예스스탁입니다. 식을 수정했습니다. S1값은 101500으로 사용하시면 되며 10시 15분봉 이전에 허수봉과 같은 봉이 하나가 더 있는데 해당봉의 종가가 저장되지 않아 값이 달랐습니다. input : 분주기(30),P(5),분주기1(15),분주기2(5); var : S1(0),D1(0),TM(0),TF(0); var : cnt(0),sum(0),mav(0),tf1(0),entry(false),tf2(0); Array : CC[100](0),OO[100](0),HH[100](0),LL[100](0),TT[100](0),ii[100](0),O2[100](0); Array : C1[100](0),T1[100](0); if (sdate != sdate[1] and stime >= 101500) or (sdate == sdate[1] and Stime >= 101500 and stime[1] < 101500) Then { S1 = TimeToMinutes(101500); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%분주기; if (sdate != sdate[1] and stime >= 101500) or (sdate == sdate[1] and Stime >= 101500 and stime[1] < 101500) or (TF < TF[1]) or (TM >= TM[1]+분주기) Then { OO[0] = o; HH[0] = H; LL[0] = L; TT[0] = stime; ii[0] = 0; for cnt = 1 to 99 { OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; TT[cnt] = TT[cnt-1][1]; ii[cnt] = ii[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; ii[0] = ii[0]+1; TF1 = TM%분주기1; if (sdate != sdate[1] and stime >= 101500) or (sdate == sdate[1] and Stime >= 101500 and stime[1] < 101500) or (TF1 < TF1[1]) or (TM >= TM[1]+분주기) Then { T1[0] = stime; for cnt = 1 to 99 { C1[cnt] = C1[cnt-1][1]; T1[cnt] = T1[cnt-1][1]; } } C1[0] = C; TF2 = TM%분주기2; if (sdate != sdate[1] and stime >= 101500) or (sdate == sdate[1] and Stime >= 101500 and stime[1] < 101500) or (TF2 < TF2[1]) or (TM >= TM[1]+분주기) Then { O2[0] = o; for cnt = 1 to 99 { O2[cnt] = O2[cnt-1][1]; } } entry = true; if (stime >= 10000 and stime < 45000) and ii[1]+ii[2] < 30 Then entry = false; if stime >= 120000 and stime < 165000 and ii[1]+ii[2] < 45 Then entry = false; var75 = highest(H,250); var76 = Lowest(L,250); if (stime >= 111500 and stime < 165000) and var75 <= var76+PriceScale*60 Then entry = false; } var2 = (c+cc[1]+cc[2]+cc[3]+cc[4])/5 ; Plot1(var2); 즐거운 하루되세요 > 겐지 님이 쓴 글입니다. > 제목 : 문의드립니다~ > input : 분주기(30),P(5),분주기1(15),분주기2(5); var : S1(0),D1(0),TM(0),TF(0); var : cnt(0),sum(0),mav(0),tf1(0),TFF(0),entry(false),tf2(0); Array : CC[100](0),OO[100](0),HH[100](0),LL[100](0),TT[100](0),ii[100](0),O2[100](0); Array : C1[100](0),T1[100](0); if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) Then{ S1 = TimeToMinutes(100000); D1 = sdate; } if D1 > 0 then{ if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TFF = TM%60; TF = TM%분주기; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or (TF < TF[1]) Then{ OO[0] = o; HH[0] = H; LL[0] = L; TT[0] = stime; ii[0] = 0; for cnt = 1 to 99{ OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; TT[cnt] = TT[cnt-1][1]; ii[cnt] = ii[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; ii[0] = ii[0]+1; TF1 = TM%분주기1; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or (TF1 < TF1[1]) Then{ T1[0] = stime; for cnt = 1 to 99{ C1[cnt] = C1[cnt-1][1]; T1[cnt] = T1[cnt-1][1]; } } C1[0] = C; TF2 = TM%분주기2; if (sdate != sdate[1] and stime >= 100000) or (sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or (TF2 < TF2[1]) Then{ O2[0] = o; for cnt = 1 to 99{ O2[cnt] = O2[cnt-1][1]; } } entry = true; if (stime >= 10000 and stime < 45000) and ii[1]+ii[2] < 30 Then entry = false; if stime >= 120000 and stime < 165000 and ii[1]+ii[2] < 45 Then entry = false; var75 = highest(H,250); var76 = Lowest(L,250); if (stime >= 111500 and stime < 165000) and var75 <= var76+PriceScale*60 Then entry = false; } var2 = (c+cc[1]+cc[2]+cc[3]+cc[4])/5 ; Plot1(var2); 질문: 항생에서 30분봉5일선을 구해서 사용하고 있습니다.~ 그런데 30분봉5일선가격이 맞지않아서 계산해 보니깐 계산대로는 오전10시15분에 오픈하고나면은 오픈시간의 5일선가격이 10시15분가격과 그리고 이전종가인 전일의1시30분가격이 더해지고 그리고 그 전의 종가가 더해져서 30분봉 5일선가격이 정해져야되는데 바로이전가격이 10시가격이 되어서 더해지는 문제가 있습니다.~ 즉 10시15분에 오픈하면 10시15분과 그리고 이전종가가 10시가격으로 적용되어서 이중으로더해져서 계산이 됩니다. S1 = TimeToMinutes(100000); 이부분을 S1 = TimeToMinutes(101500); 이렇게 바꿔서 적용해보니깐 제대로 되는데 30분단위로 계산이 안되고 15분45분이렇게 계산이 되네요~ 10시15분오픈하면은 10시15분과 전일1시30분으로 계산이 되고 이후로는 10시30분부터 되도록 식 수정좀 부탁드릴게요~