PINE LIBRARY
업데이트됨 catchChecks

Library "catchChecks"
Type Check for Function Builders to allow Single item to be
passed in, and determine what to do with the item, ie: need an x value?
function that allows label, line, box, float, or even a string..
check item type? string ? 'str.tonumber(_item)' can be in the same
switch as a 'line.get_price(_item, bar_index)' both outputting float
or for pulling a value from simple, array, or matrix, one function
that can switch between them. reduce overhead of many functions.
there are many ways to use this tool, the simplest may be
string/floats on one switch or grabbing colors from line/fill/label
please Share any great recipes you come up with!
typeIs(_temp, _doMeth)
Input anything..
Determine what it is.
Parameters:
_temp: (any) Matrix, Array, or Simple Item
_doMeth: (bool) True for M/A/S , false for int/float/string.. etc..
Returns: (string) Type of item checked. ('bool' .. or 'array'.. etc..)
Type Check for Function Builders to allow Single item to be
passed in, and determine what to do with the item, ie: need an x value?
function that allows label, line, box, float, or even a string..
check item type? string ? 'str.tonumber(_item)' can be in the same
switch as a 'line.get_price(_item, bar_index)' both outputting float
or for pulling a value from simple, array, or matrix, one function
that can switch between them. reduce overhead of many functions.
there are many ways to use this tool, the simplest may be
string/floats on one switch or grabbing colors from line/fill/label
please Share any great recipes you come up with!
typeIs(_temp, _doMeth)
Input anything..
Determine what it is.
Parameters:
_temp: (any) Matrix, Array, or Simple Item
_doMeth: (bool) True for M/A/S , false for int/float/string.. etc..
Returns: (string) Type of item checked. ('bool' .. or 'array'.. etc..)
릴리즈 노트
v2Big udate, now logs everything,check a map keys array.. and faster, simpler..
also returns type inf string..
To help anyabsent minded Pine Programmers to find if they've accidentally misconfigured, or other Clever uses .. =)
example logs below
--- Basic Type Checks ---
Detected Type: -- int
Detected Type: -- float
Detected Type: -- color
Detected Type: -- line
Detected Type: -- label
Detected Type: -- box
Detected Type: -- table
Detected Type: -- linefill
Detected Type: -- polyline
Detected Type: -- chart.point
Detected Type: -- label
--- Container Type Checks ---
Detected Type: matrix<color> -- color
Detected Type: matrix<chart.point> -- chart.point
Detected Type: matrix<line> -- line
Detected Type: array<float> -- float
Detected Type: array<bool> -- bool
Detected Type: array<string> -- string
Detected Type: array<polyline> -- polyline
--- Collection Element Type Checks ---
Detected Type: matrix<int> -- matrix
Detected Type: matrix<linefill> -- matrix
Detected Type: matrix<polyline> -- matrix
Detected Type: array<int> -- array
Detected Type: array<float> -- array
--- Map Key Helper Checks ---
Detected Type: array<string> -- string
Map Key Type: string
Detected Type: array<int> -- int
Map Key Type: int
String Map Key Type: string, Int Map Key Type: int
Suggested Next String Key: key_2
Suggested Next Int Key: 6
Suggested Next Int Key: 0
Next String Key: key_2, Next Int Key: 6, Next Int Key (Empty): 0
Added:
getMapKeyType(_keys)
Parameters:
_keys (array<bool>)
getNextMapKey(_keys, _prefix)
Parameters:
_keys (array<string>)
_prefix (string)
Updated:
typeIs(_item, _getContainerType)
Parameters:
_item (matrix<chart.point>)
_getContainerType (bool)
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.