커뮤니티

수식수정부탁합니다

프로필 이미지
이카도로
2020-09-07 15:28:23
816
글번호 142096
답변완료
안녕하세요 지표 수식 잘 활용하고있읍니다. 항상 감사드립니다 좀 불편한 점이 있어서 그림파일같이 수정이가능하지요. input : 분(30),값(0); var : S1(0),D1(0),TM(0),TF(0),dd(0),tt(0); var : hh(0),ll(0),TL1(0),TL2(0),TL3(0),TL31(0),TL32(0); var : tx1(0),tx2(0),tx3(0),tx31(0),Tx32(0),DD1(0),TT1(0),vv1(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%분; if Bdate != Bdate[1] or (Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or (Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then { hh = h; ll = l; dd = sDate; tt = sTime; TL31 = TL3[1]; TL32 = TL31[1]; TL_SetExtRight(TL32,False); TL1 = TL_New(dd,tt,hh,NextBarSdate,NextBarStime,hh); TL2 = TL_New(dd,tt,ll,NextBarSdate,NextBarStime,ll); TL3 = TL_New(dd,tt,(hh+ll)/2,NextBarSdate,NextBarStime,(hh+ll)/2); TL_SetColor(TL1,RED); TL_SetColor(TL2,BLUE); TL_SetColor(TL3,BLACK); TL_SetExtRight(TL3,true); Text_SetStyle(tx1,2,1); Text_SetStyle(tx2,2,0); Text_SetStyle(tx3,2,0); Text_SetSize(Tx2, 11); Tx31 = Tx3[1]; Tx1 = Text_New(dd,tt,hh,"H"+NewLine+NumToStr(hh,값)); Tx2 = Text_New(dd,tt,ll,NumToStr(ll,값)+NewLine+"L"); Tx3 = Text_New(dd,tt,(hh+ll)/2,"M"+NumToStr((hh+ll)/2*4,값)+NewLine+NumToStr(hh-ll,값)); Text_SetColor(Tx1,RED); Text_SetColor(Tx2,BLUE); Text_SetColor(Tx3,BLACK); Text_SetStyle(tx1,0,2); Text_SetStyle(tx2,0,0); Text_SetStyle(tx3,0,0); } Else { if h > hh Then { hh = h; TL_SetBegin(tl1,dd,tt,hh); TL_SetBegin(tl3,dd,tt,(hh+ll)/2); } if l < ll Then { ll = l; TL_SetBegin(tl2,dd,tt,ll); TL_SetBegin(tl3,dd,tt,(hh+ll)/2); } TL_SetEnd(TL1,sDate,sTime,hh); TL_SetEnd(TL2,sDate,sTime,ll); TL_SetEnd(TL3,sDate,sTime,(hh+ll)/2); Text_SetString(Tx1,NumToStr((hh-ll)*4,0)+NewLine+"H"+NumToStr(hh,값)); Text_SetStyle(Tx1, 2, 0); Text_SetSize(Tx1, 11); Text_SetString(Tx2,NumToStr(ll,값)+NewLine+"L"); Text_SetStyle(Tx2, 2, 0); Text_SetSize(Tx2, 11); Text_SetString(Tx3,"M"+NumToStr((hh+ll)/2,값)+NewLine+NumToStr((hh-ll)/2*4,0)); Text_SetStyle(Tx3, 2, 0); Text_SetSize(Tx3, 11); Text_SetLocation(Tx1,sDate,sTime,hh); Text_SetLocation(Tx2,sDate,sTime,ll); Text_SetLocation(Tx3,sDate,sTime,(hh+ll)/2); } }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-09-07 14:28:42

안녕하세요 예스스탁입니다. 텍스트가 봉을 기준으로만 출력이 됩니다. 마지막봉에 표시되는 표시는 오른쪽으로 정렬해서 표시되게 하고 과거 표시는 구간의 중간에 표시되게 수정해 드립니다. input : 분(30),값(0); var : S1(0),D1(0),TM(0),TF(0),dd(0),tt(0),idx(0); var : hh(0),ll(0),TL1(0),TL2(0),TL3(0),TL31(0),TL32(0); var : tx1(0),tx2(0),tx3(0),tx31(0),Tx32(0),DD1(0),TT1(0),vv1(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%분; if Bdate != Bdate[1] or (Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or (Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then { hh = h; ll = l; dd = sDate; tt = sTime; TL31 = TL3[1]; TL32 = TL31[1]; TL_SetExtRight(TL32,False); TL1 = TL_New(dd,tt,hh,NextBarSdate,NextBarStime,hh); TL2 = TL_New(dd,tt,ll,NextBarSdate,NextBarStime,ll); TL3 = TL_New(dd,tt,(hh+ll)/2,NextBarSdate,NextBarStime,(hh+ll)/2); TL_SetColor(TL1,RED); TL_SetColor(TL2,BLUE); TL_SetColor(TL3,BLACK); TL_SetExtRight(TL3,true); Text_SetLocation(Tx1,sDate[Ceiling(idx/2)],sTime[Ceiling(idx/2)],hh[1]); Text_SetLocation(Tx2,sDate[Ceiling(idx/2)],sTime[Ceiling(idx/2)],ll[1]); Text_SetLocation(Tx3,sDate[Ceiling(idx/2)],sTime[Ceiling(idx/2)],(hh[1]+ll[1])/2); Text_SetStyle(tx1,2,1); Text_SetStyle(tx2,2,0); Text_SetStyle(tx3,2,0); Text_SetSize(Tx2, 11); Tx31 = Tx3[1]; Tx1 = Text_New(dd,tt,hh,"H"+NewLine+NumToStr(hh,값)); Tx2 = Text_New(dd,tt,ll,NumToStr(ll,값)+NewLine+"L"); Tx3 = Text_New(dd,tt,(hh+ll)/2,"M"+NumToStr((hh+ll)/2*4,값)+NewLine+NumToStr(hh-ll,값)); Text_SetColor(Tx1,RED); Text_SetColor(Tx2,BLUE); Text_SetColor(Tx3,BLACK); Text_SetStyle(tx1,0,2); Text_SetStyle(tx2,0,0); Text_SetStyle(tx3,0,0); idx = 0; } Else { idx = idx+1; if h > hh Then { hh = h; TL_SetBegin(tl1,dd,tt,hh); TL_SetBegin(tl3,dd,tt,(hh+ll)/2); } if l < ll Then { ll = l; TL_SetBegin(tl2,dd,tt,ll); TL_SetBegin(tl3,dd,tt,(hh+ll)/2); } TL_SetEnd(TL1,sDate,sTime,hh); TL_SetEnd(TL2,sDate,sTime,ll); TL_SetEnd(TL3,sDate,sTime,(hh+ll)/2); Text_SetString(Tx1,NumToStr((hh-ll)*4,0)+NewLine+"H"+NumToStr(hh,값)); Text_SetStyle(Tx1, 0, 0); Text_SetSize(Tx1, 11); Text_SetString(Tx2,NumToStr(ll,값)+NewLine+"L"); Text_SetStyle(Tx2, 0, 0); Text_SetSize(Tx2, 11); Text_SetString(Tx3,"M"+NumToStr((hh+ll)/2,값)+NewLine+NumToStr((hh-ll)/2*4,0)); Text_SetStyle(Tx3, 0, 0); Text_SetSize(Tx3, 11); Text_SetLocation(Tx1,sDate,sTime,hh); Text_SetLocation(Tx2,sDate,sTime,ll); Text_SetLocation(Tx3,sDate,sTime,(hh+ll)/2); } } 즐거운 하루되세요 > 이카도로 님이 쓴 글입니다. > 제목 : 수식수정부탁합니다 > 안녕하세요 지표 수식 잘 활용하고있읍니다. 항상 감사드립니다 좀 불편한 점이 있어서 그림파일같이 수정이가능하지요. input : 분(30),값(0); var : S1(0),D1(0),TM(0),TF(0),dd(0),tt(0); var : hh(0),ll(0),TL1(0),TL2(0),TL3(0),TL31(0),TL32(0); var : tx1(0),tx2(0),tx3(0),tx31(0),Tx32(0),DD1(0),TT1(0),vv1(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%분; if Bdate != Bdate[1] or (Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or (Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then { hh = h; ll = l; dd = sDate; tt = sTime; TL31 = TL3[1]; TL32 = TL31[1]; TL_SetExtRight(TL32,False); TL1 = TL_New(dd,tt,hh,NextBarSdate,NextBarStime,hh); TL2 = TL_New(dd,tt,ll,NextBarSdate,NextBarStime,ll); TL3 = TL_New(dd,tt,(hh+ll)/2,NextBarSdate,NextBarStime,(hh+ll)/2); TL_SetColor(TL1,RED); TL_SetColor(TL2,BLUE); TL_SetColor(TL3,BLACK); TL_SetExtRight(TL3,true); Text_SetStyle(tx1,2,1); Text_SetStyle(tx2,2,0); Text_SetStyle(tx3,2,0); Text_SetSize(Tx2, 11); Tx31 = Tx3[1]; Tx1 = Text_New(dd,tt,hh,"H"+NewLine+NumToStr(hh,값)); Tx2 = Text_New(dd,tt,ll,NumToStr(ll,값)+NewLine+"L"); Tx3 = Text_New(dd,tt,(hh+ll)/2,"M"+NumToStr((hh+ll)/2*4,값)+NewLine+NumToStr(hh-ll,값)); Text_SetColor(Tx1,RED); Text_SetColor(Tx2,BLUE); Text_SetColor(Tx3,BLACK); Text_SetStyle(tx1,0,2); Text_SetStyle(tx2,0,0); Text_SetStyle(tx3,0,0); } Else { if h > hh Then { hh = h; TL_SetBegin(tl1,dd,tt,hh); TL_SetBegin(tl3,dd,tt,(hh+ll)/2); } if l < ll Then { ll = l; TL_SetBegin(tl2,dd,tt,ll); TL_SetBegin(tl3,dd,tt,(hh+ll)/2); } TL_SetEnd(TL1,sDate,sTime,hh); TL_SetEnd(TL2,sDate,sTime,ll); TL_SetEnd(TL3,sDate,sTime,(hh+ll)/2); Text_SetString(Tx1,NumToStr((hh-ll)*4,0)+NewLine+"H"+NumToStr(hh,값)); Text_SetStyle(Tx1, 2, 0); Text_SetSize(Tx1, 11); Text_SetString(Tx2,NumToStr(ll,값)+NewLine+"L"); Text_SetStyle(Tx2, 2, 0); Text_SetSize(Tx2, 11); Text_SetString(Tx3,"M"+NumToStr((hh+ll)/2,값)+NewLine+NumToStr((hh-ll)/2*4,0)); Text_SetStyle(Tx3, 2, 0); Text_SetSize(Tx3, 11); Text_SetLocation(Tx1,sDate,sTime,hh); Text_SetLocation(Tx2,sDate,sTime,ll); Text_SetLocation(Tx3,sDate,sTime,(hh+ll)/2); } }