커뮤니티

문의드립니다.

프로필 이미지
해암
2025-04-03 06:42:54
294
글번호 189800
답변완료
아래 수식은 분봉차트에 사용하는 지표입니다. 이 지표를 틱봉차트에 나타내고자 합니다. 분봉의 기간값은 수정가능하게 부탁드립니다. 항상 감사드립니다. 수고하세요!!! ====================== input : left(5),right(5); input : left1(30),right1(30); input : dist(2.00); input : upcolor(White); input : downcolor(White); var : ph(0),currenth(0),lasth(0),pl(0),currentl(0),lastl(0); var : ms(0),l1(0),l2(0),l3(0),l4(0); if SwingHigh(1,H,left,right,Left+right+1) != -1 Then { ph = H[right]; currenth = h[right]; lasth = currenth[1]; l1 = TL_New(sDate[right],sTime[right],ph,sDate,sTime,ph); TL_SetColor(l1,upcolor); TL_SetStyle(l1,3); var1 = Index; } Else { if var1 > 0 and Index <= var1+Round(Right/2,0) Then TL_SetEnd(l1,sDate,sTime,ph); } if Swinglow(1,L,left,right,Left+right+1) != -1 Then { pl = L[right]; currentl = l[right]; lastl = currentl[1]; l2 = TL_New(sDate[right],sTime[right],pl,sDate,sTime,pl); TL_SetColor(l2,downcolor); TL_SetStyle(l2,3); var2 = Index; } Else { if var2 > 0 and Index <= var2+Round(Right/2,0) Then TL_SetEnd(l2,sDate,sTime,pl); } if currenth > lasth and currentl > lastl and close > ph Then ms = 2; else if currenth < lasth and currentl < lastl and close < pl Then ms = -2; else if close > ph Then ms = 1; else if close < pl Then ms = -1; var : longsig(False),shortsig(False),longsig1(False),shortsig1(False); var : longsig2(False),shortsig2(false),longexit(False),shortexit(False); var : ph1(0),pl1(0),mav(0),a(0),ma2(0),ma3(0); longsig = close > ph and ms[1] < 0; shortsig = close < pl and ms[1] > 0; longsig1 = close > ph and ms[1] > 0; shortsig1 = close < pl and ms[1] < 0; longsig2 = longsig1 and longsig1[1] == false and longsig[1] == false; shortsig2 = shortsig1 and shortsig1[1] == false and shortsig[1] == false; longexit = high > ph and close < ph; shortexit = low < pl and close > pl; if SwingHigh(1,H,left1,right1,Left1+right1+1) != -1 Then { ph1 = H[right1]; l3 = TL_New(sDate[right1],sTime[right1],ph1,sDate,sTime,ph1); TL_SetColor(l3,upcolor); TL_SetDrawMode(l3,0); var3 = Index; } Else { if var3 > 0 and Index <= var3+Round(Right1/2,0) Then TL_SetEnd(l3,sDate,sTime,ph1); } if Swinglow(1,L,left1,right1,Left1+right1+1) != -1 Then { pl1 = L[right1]; l4 = TL_New(sDate[right1],sTime[right1],pl1,sDate,sTime,pl1); TL_SetColor(l4,downcolor); TL_SetDrawMode(l4,0); var4 = Index; } Else { if var4 > 0 and Index <= var4+Round(Right1/2,0) Then TL_SetEnd(l4,sDate,sTime,pl1); } // Zone mav = ma(close, left1); a = atr(left1); ma2 = iff(ms > 0 and ms[1] > 0 , mav - a * dist ,IFf( ms < 0 and ms[1] < 0 , mav + a*dist , Nan)); ma3 = iff(ms > 0 and ms[1] > 0 , ma2 + a ,IFf( ms < 0 and ms[1] < 0 , ma2 - a , Nan)); var : tx1(0),tx2(0),tx3(0),tx4(0),tx5(0),tx6(0); if longsig Then { tx1 = Text_New(sDate,sTime,L,"↑"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Blue); } if longsig2 Then { tx2 = Text_New(sDate,sTime,L,"↑"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,Blue); } if shortsig Then { tx3 = Text_New(sDate,sTime,H,"↓"); Text_SetStyle(tx3,2,1); Text_SetColor(tx3,Red); } if shortsig2 Then { tx4 = Text_New(sDate,sTime,H,"↓"); Text_SetStyle(tx4,2,1); Text_SetColor(tx4,Red); } plot1(ma2, "External Zone", IFf(close > ma2 , upcolor, IFf(close < ma2 , downcolor, Nan))); plot2(ma3, "Internal Zone", iff(close > ma2 , upcolor, iff(close < ma2 , downcolor, Nan)));
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-04-03 11:23:15

안녕하세요 예스스탁입니다. 올려주신 내용은 작성해 보는데 시간이 많이 걸리는 내용입니다. 업무상 일정시간이상 요구되는 내용은 작성해 드리지 않습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 해암 님이 쓴 글입니다. > 제목 : 문의드립니다. > 아래 수식은 분봉차트에 사용하는 지표입니다. 이 지표를 틱봉차트에 나타내고자 합니다. 분봉의 기간값은 수정가능하게 부탁드립니다. 항상 감사드립니다. 수고하세요!!! ====================== input : left(5),right(5); input : left1(30),right1(30); input : dist(2.00); input : upcolor(White); input : downcolor(White); var : ph(0),currenth(0),lasth(0),pl(0),currentl(0),lastl(0); var : ms(0),l1(0),l2(0),l3(0),l4(0); if SwingHigh(1,H,left,right,Left+right+1) != -1 Then { ph = H[right]; currenth = h[right]; lasth = currenth[1]; l1 = TL_New(sDate[right],sTime[right],ph,sDate,sTime,ph); TL_SetColor(l1,upcolor); TL_SetStyle(l1,3); var1 = Index; } Else { if var1 > 0 and Index <= var1+Round(Right/2,0) Then TL_SetEnd(l1,sDate,sTime,ph); } if Swinglow(1,L,left,right,Left+right+1) != -1 Then { pl = L[right]; currentl = l[right]; lastl = currentl[1]; l2 = TL_New(sDate[right],sTime[right],pl,sDate,sTime,pl); TL_SetColor(l2,downcolor); TL_SetStyle(l2,3); var2 = Index; } Else { if var2 > 0 and Index <= var2+Round(Right/2,0) Then TL_SetEnd(l2,sDate,sTime,pl); } if currenth > lasth and currentl > lastl and close > ph Then ms = 2; else if currenth < lasth and currentl < lastl and close < pl Then ms = -2; else if close > ph Then ms = 1; else if close < pl Then ms = -1; var : longsig(False),shortsig(False),longsig1(False),shortsig1(False); var : longsig2(False),shortsig2(false),longexit(False),shortexit(False); var : ph1(0),pl1(0),mav(0),a(0),ma2(0),ma3(0); longsig = close > ph and ms[1] < 0; shortsig = close < pl and ms[1] > 0; longsig1 = close > ph and ms[1] > 0; shortsig1 = close < pl and ms[1] < 0; longsig2 = longsig1 and longsig1[1] == false and longsig[1] == false; shortsig2 = shortsig1 and shortsig1[1] == false and shortsig[1] == false; longexit = high > ph and close < ph; shortexit = low < pl and close > pl; if SwingHigh(1,H,left1,right1,Left1+right1+1) != -1 Then { ph1 = H[right1]; l3 = TL_New(sDate[right1],sTime[right1],ph1,sDate,sTime,ph1); TL_SetColor(l3,upcolor); TL_SetDrawMode(l3,0); var3 = Index; } Else { if var3 > 0 and Index <= var3+Round(Right1/2,0) Then TL_SetEnd(l3,sDate,sTime,ph1); } if Swinglow(1,L,left1,right1,Left1+right1+1) != -1 Then { pl1 = L[right1]; l4 = TL_New(sDate[right1],sTime[right1],pl1,sDate,sTime,pl1); TL_SetColor(l4,downcolor); TL_SetDrawMode(l4,0); var4 = Index; } Else { if var4 > 0 and Index <= var4+Round(Right1/2,0) Then TL_SetEnd(l4,sDate,sTime,pl1); } // Zone mav = ma(close, left1); a = atr(left1); ma2 = iff(ms > 0 and ms[1] > 0 , mav - a * dist ,IFf( ms < 0 and ms[1] < 0 , mav + a*dist , Nan)); ma3 = iff(ms > 0 and ms[1] > 0 , ma2 + a ,IFf( ms < 0 and ms[1] < 0 , ma2 - a , Nan)); var : tx1(0),tx2(0),tx3(0),tx4(0),tx5(0),tx6(0); if longsig Then { tx1 = Text_New(sDate,sTime,L,"↑"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Blue); } if longsig2 Then { tx2 = Text_New(sDate,sTime,L,"↑"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,Blue); } if shortsig Then { tx3 = Text_New(sDate,sTime,H,"↓"); Text_SetStyle(tx3,2,1); Text_SetColor(tx3,Red); } if shortsig2 Then { tx4 = Text_New(sDate,sTime,H,"↓"); Text_SetStyle(tx4,2,1); Text_SetColor(tx4,Red); } plot1(ma2, "External Zone", IFf(close > ma2 , upcolor, IFf(close < ma2 , downcolor, Nan))); plot2(ma3, "Internal Zone", iff(close > ma2 , upcolor, iff(close < ma2 , downcolor, Nan)));