PINE LIBRARY
업데이트됨 SessionInfo

Library "SessionInfo"
Utility functions for session specific information like the bar index of the session.
inSession(spec) Returns true if the current bar is in the session specification.
Parameters:
spec: session.regular (default), session.extended or other time spec.
Returns: True if the current is in session; otherwise false.
minutesToLen(minutes, multiple) Converts the number of minutes to a length to be used with indicators.
Parameters:
minutes: The number of minutes.
multiple: The length multiplier.
Returns: math.ceil(minutes * multiple / timeframe.multiplier)
bar(spec, res) Returns the intraday bar index. May not always map directly to time as a bars can be skipped.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The integer index of the bar of the session.
isFirstBar(spec, res) Returns true if the current bar is the first one of the session.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: True if the current bar is the first one of the session.
wasLastBar(spec, res) Returns Returns true if the previous bar was the last of the session.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: True if was the last bar of the session.
Utility functions for session specific information like the bar index of the session.
inSession(spec) Returns true if the current bar is in the session specification.
Parameters:
spec: session.regular (default), session.extended or other time spec.
Returns: True if the current is in session; otherwise false.
minutesToLen(minutes, multiple) Converts the number of minutes to a length to be used with indicators.
Parameters:
minutes: The number of minutes.
multiple: The length multiplier.
Returns: math.ceil(minutes * multiple / timeframe.multiplier)
bar(spec, res) Returns the intraday bar index. May not always map directly to time as a bars can be skipped.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The integer index of the bar of the session.
isFirstBar(spec, res) Returns true if the current bar is the first one of the session.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: True if the current bar is the first one of the session.
wasLastBar(spec, res) Returns Returns true if the previous bar was the last of the session.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: True if was the last bar of the session.
릴리즈 노트
v2Added:
maxBars(spec, res) Returns maximum (usual) number of bars per day.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The max (usual) number of bars per day.
maxMinutes(spec, res) Returns maximum (usual) number of minutes per day.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The max (usual) number of minutes per day.
daysToBars(spec, res) Returns the number of bars equal to the number of days based upon usual session length.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The number of bars representing the number of days.
릴리즈 노트
v3Added:
isIn(spec) Returns true if the current bar is in the session specification.
Parameters:
spec: session.regular (default), session.extended or other time spec.
Returns: True if the current is in session; otherwise false.
isBefore(spec, res) Returns true if the bar is before before the session (default = regular) opens.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = timeframe.period).
Returns: True if before the session.
isAfter(spec, res) Returns true if the bar is before before the session (default = regular) opens.
Parameters:
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = timeframe.period).
Returns: True if before the session.
firstBarOfDay(daysBack, spec, res) Returns the number bars in the past to find the first bar of the session of a given day.
Parameters:
daysBack: The number of days in the past to count the bars.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The number bars in the past to find the first bar of the session of a given day.
Removed:
inSession(spec) Returns true if the current bar is in the session specification.
릴리즈 노트
v4Added:
lastBarOfDay(daysBack, spec, res) Returns the number bars in the past to find the last bar of the session of a given day.
Parameters:
daysBack: The number of days in the past to count the bars.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = "1440").
Returns: The number bars in the past to find the last bar of the session of a given day.
릴리즈 노트
v5릴리즈 노트
v6Fixed bug in array initialization.
릴리즈 노트
v7Fixed bug in firstBarOfDay
릴리즈 노트
v8 Improved timeframe detection and response.릴리즈 노트
v9 param name change and improved runtime error messagesUpdated:
firstBarOfDay(daysPrior, spec, res) Returns the number bars in the past to find the first bar of the session of a given day.
Parameters:
daysPrior: The number of days in the past to count the bars.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = '1440').
Returns: The number bars in the past to find the first bar of the session of a given day.
lastBarOfDay(daysPrior, spec, res) Returns the number bars in the past to find the last bar of the session of a given day.
Parameters:
daysPrior: The number of days in the past to count the bars.
spec: session.regular (default), session.extended or other time spec.
res: The resolution (default = '1440').
Returns: The number bars in the past to find the last bar of the session of a given day.
릴리즈 노트
v10 Corrected issue with .maxBars()릴리즈 노트
v11Improved performance by using profiler and optimizing where possible.
Added:
isNewDay()
Returns true if the current bar is the first of a new day. Only useful for intraday timeframe.
Returns: True if the current is in session; otherwise false.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.