PINE LIBRARY
Mirpapa_Lib_Line

Library "Mirpapa_Lib_Line"
CreateLine(_breachMode, _isBull, _leftTime, _rightTime, _price, _lineColor, _lineWidth, _lineStyle, _text)
CreateLine
description 라인 생성 (값 전달 방식 - 모든 좌표 직접 지정).\
호출자가 모든 좌표와 시간을 계산하여 전달.\
breachMode: "price"(고가/저가 돌파) 또는 "close"(종가 돌파).\
Parameters:
_breachMode (string): 돌파 처리 방식: "price" 또는 "close"
_isBull (bool): 상승(true) 또는 하락(false)
_leftTime (int): 라인 시작 시간
_rightTime (int): 라인 종료 시간
_price (float): 라인 가격
_lineColor (color): 라인 색상
_lineWidth (int): 라인 두께
_lineStyle (string): 라인 스타일 (line.style_solid, line.style_dashed 등)
_text (string): 라인 텍스트
Returns: [bool, LineData] 성공 여부와 라인 데이터
ProcessLineDatas(_openLines, _closedLines, _closeCount, _colorClose, _currentBarIndex, _currentLow, _currentHigh, _currentTime)
ProcessLineDatas
description 라인 확장 및 돌파 처리.\
열린 라인들을 현재 bar까지 확장하고, 돌파 조건 체크.\
_closeCount: 돌파 횟수 (이 횟수만큼 돌파 시 라인 종료).\
breachMode에 따라 돌파 체크 방식 다름 (price/close).\
종료된 라인은 _closedLines로 이동하고 _colorClose 색상 적용.\
barstate.islast와 barstate.isconfirmed에서 호출 권장.
Parameters:
_openLines (array<LineData>): 열린 라인 배열
_closedLines (array<LineData>): 닫힌 라인 배열
_closeCount (int): 돌파 카운트 (이 횟수만큼 돌파 시 종료)
_colorClose (color): 종료된 라인 색상
_currentBarIndex (int): 현재 bar_index
_currentLow (float): 현재 low
_currentHigh (float): 현재 high
_currentTime (int): 현재 time
Returns: bool 항상 true
BreachMode
BreachMode
Fields:
PRICE (series string)
CLOSE (series string)
LineData
LineData
Fields:
_breachMode (series string): 돌파 처리 방식
_isBull (series bool): 상승(true) 또는 하락(false) 방향
_line (series line): 라인 객체
_price (series float): 라인 가격
_text (series string): 라인 텍스트
_breached (series bool): 돌파 여부
_breakCount (series int): 돌파 카운트
CreateLine(_breachMode, _isBull, _leftTime, _rightTime, _price, _lineColor, _lineWidth, _lineStyle, _text)
CreateLine
description 라인 생성 (값 전달 방식 - 모든 좌표 직접 지정).\
호출자가 모든 좌표와 시간을 계산하여 전달.\
breachMode: "price"(고가/저가 돌파) 또는 "close"(종가 돌파).\
Parameters:
_breachMode (string): 돌파 처리 방식: "price" 또는 "close"
_isBull (bool): 상승(true) 또는 하락(false)
_leftTime (int): 라인 시작 시간
_rightTime (int): 라인 종료 시간
_price (float): 라인 가격
_lineColor (color): 라인 색상
_lineWidth (int): 라인 두께
_lineStyle (string): 라인 스타일 (line.style_solid, line.style_dashed 등)
_text (string): 라인 텍스트
Returns: [bool, LineData] 성공 여부와 라인 데이터
ProcessLineDatas(_openLines, _closedLines, _closeCount, _colorClose, _currentBarIndex, _currentLow, _currentHigh, _currentTime)
ProcessLineDatas
description 라인 확장 및 돌파 처리.\
열린 라인들을 현재 bar까지 확장하고, 돌파 조건 체크.\
_closeCount: 돌파 횟수 (이 횟수만큼 돌파 시 라인 종료).\
breachMode에 따라 돌파 체크 방식 다름 (price/close).\
종료된 라인은 _closedLines로 이동하고 _colorClose 색상 적용.\
barstate.islast와 barstate.isconfirmed에서 호출 권장.
Parameters:
_openLines (array<LineData>): 열린 라인 배열
_closedLines (array<LineData>): 닫힌 라인 배열
_closeCount (int): 돌파 카운트 (이 횟수만큼 돌파 시 종료)
_colorClose (color): 종료된 라인 색상
_currentBarIndex (int): 현재 bar_index
_currentLow (float): 현재 low
_currentHigh (float): 현재 high
_currentTime (int): 현재 time
Returns: bool 항상 true
BreachMode
BreachMode
Fields:
PRICE (series string)
CLOSE (series string)
LineData
LineData
Fields:
_breachMode (series string): 돌파 처리 방식
_isBull (series bool): 상승(true) 또는 하락(false) 방향
_line (series line): 라인 객체
_price (series float): 라인 가격
_text (series string): 라인 텍스트
_breached (series bool): 돌파 여부
_breakCount (series int): 돌파 카운트
Pine library
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Pine library
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.