커뮤니티

수식 변경 요청 드립니다.

프로필 이미지
졸던
2026-02-25 11:01:01
63
글번호 230770
답변완료

트레이딩뷰의 수식 입니다만,

예스차트 수식으로 변환 요청 드립니다.

-----------------------------------------------------------------------------



//@version=5

indicator("Start Open Price", overlay=true)



openPrice = open

highPrice = high

lowPrice = low



isHourClose = (minute == 0)



isPositiveSOP = isHourClose and (openPrice == lowPrice) and (lowPrice == ta.lowest(lowPrice, 1))


isNegativeSOP = isHourClose and (openPrice == highPrice) and (highPrice == ta.highest(highPrice, 1))



var string sopText = na



if (isPositiveSOP)

sopText := str.tostring(openPrice)

label.new(bar_index, lowPrice - 1, text=sopText, style=label.style_label_up, color=color.green, textcolor=color.white, size=size.large, textalign=text.align_center)

line.new(bar_index[1], lowPrice, bar_index, lowPrice, color=color.red, width=1)



if (isNegativeSOP)

sopText := str.tostring(openPrice)

label.new(bar_index, highPrice + 1, text=sopText, style=label.style_label_down, color=color.green, textcolor=color.white, size=size.large, textalign=text.align_center)

line.new(bar_index[1], highPrice, bar_index, highPrice, color=color.blue, width=1)

else

sopText := na // 조건이 충족되지 않으면 텍스트를 비움

지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2026-02-25 17:13:34

안녕하세요 예스스탁입니다. var : openPrice(0),highPrice(0),lowPrice(0); var : S1(0),D1(0),TM(0),minute(0); var : isHourClose(False); var : isPositiveSOP(False),isNegativeSOP(False); openPrice = open; highPrice = high; lowPrice = low; 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; minute = TM%60; } isHourClose = (minute == 0); isPositiveSOP = isHourClose and (openPrice == lowPrice) and (lowPrice == lowest(lowPrice, 1)); isNegativeSOP = isHourClose and (openPrice == highPrice) and (highPrice == highest(highPrice, 1)); var : sopText(Nan),sopTL(Nan); if (isPositiveSOP) Then { sopText = Text_New(sDate,sTime,lowPrice - 1,NumToStr(openprice,2)); Text_SetStyle(sopText,2,0); Text_SetColor(sopText,Green); sopTL = TL_New(sDate[1],sTime[1],lowPrice,sDate,sTime,lowPrice); TL_SetColor(sopTL,Red); } if (isNegativeSOP) Then { sopText = Text_New(sDate,sTime,highPrice + 1,NumToStr(openprice,2)); Text_SetStyle(sopText,2,1); Text_SetColor(sopText,Green); sopTL = TL_New(sDate[1],sTime[1],highPrice,sDate,sTime,highPrice); TL_SetColor(sopTL,Blue); } 즐거운 하루되세요