PINE LIBRARY
업데이트됨 calc

Library "calc"
Library for math functions. will expand over time.
split(_sumTotal, _divideBy, _forceMinimum, _haltOnError)
Split a large number into integer sized chunks
Parameters:
_sumTotal: (int) Total numbert of items
_divideBy: (int) Groups to make
_forceMinimum: (bool) force minimum number 1/group
_haltOnError: (bool) force error if too few groups
Returns: int[] array of items per group
Library for math functions. will expand over time.
split(_sumTotal, _divideBy, _forceMinimum, _haltOnError)
Split a large number into integer sized chunks
Parameters:
_sumTotal: (int) Total numbert of items
_divideBy: (int) Groups to make
_forceMinimum: (bool) force minimum number 1/group
_haltOnError: (bool) force error if too few groups
Returns: int[] array of items per group
릴리즈 노트
v2Added:
gapSize(_value1, _value2)
Absolute distance between any two float values, agnostic to +/-
Parameters:
_value1: First value
_value2: Second value
Returns: Absolute Positive Distance
simplifyFraction(_num, _den)
Parameters:
_num: (int) Input fraction numerator
_den: (int) Input fraction dennominator
Returns: Simplified Fraction
toFraction(_input, _round)
Convert Decimal to tuple fraction Output, Rounded to tick, Round Shorter if heavy use.
Parameters:
_input: Decimal Input
_round: (OPTIONAL) round shorter to speed up.
Returns: Simplified Fraction (if negative, Numerator gets the sign)
릴리즈 노트
v3릴리즈 노트
v4Added:
percentile(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
pow10up(_src, _pow)
Power of 10 scale up
Parameters:
_src: Input value
_pow: Number of * 10 to perform
pow10dn(_src, _pow)
Power of 10 scale down
Parameters:
_src: Input value
_pow: Number of / 10 to perform
pow10chk(_src)
Power of 10 to req to integer
Parameters:
_src: Input value) =>
릴리즈 노트
v5Major speed improvement on fractions (Thank you Stack overflow)
Fix on Output for start/end == same values on percent, and rename
now gets 0 if starrt == end.
Added:
percentOfDistance(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
fractionOfDistance(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
Returns: [Num,Denom] fraction
pow10(_src, _pow)
Power of 10 scale up
Parameters:
_src: Input value
_pow: Number of * 10 to perform
Returns: Value with decimal moved + right, - left
Updated:
toFraction(_input, _epsilon, _iterations)
Convert Decimal to tuple fraction Output, 1/0 resolves to [1,1]
note : it is suboptimal, will be updating with a much faster algorithm
Parameters:
_input: Decimal Input
_epsilon: (OPTIONAL) to precision (10e-N)
_iterations: Maximum iterations (OPTIONAL)
Returns: [num,den] Simplified Fraction (if negative, Numerator gets the sign)
Removed:
percentile(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
pow10up(_src, _pow)
Power of 10 scale up
pow10dn(_src, _pow)
Power of 10 scale down
릴리즈 노트
v6Added:
from_center(_src, _mid)
Parameters:
_src (float)
_mid (float)
릴리즈 노트
v7Added:
count_digits(num)
Measure the integer digit count of a float
Parameters:
num (float): (float) Input value
Returns: Number of digits
auto_inv_pow(source, power)
Inverse power of a floatbased on digit count
Parameters:
source (float): (float) Input value
power (float): (float) (OPTIONAL) Power to raise to (default 1))
Updated:
from_center(_src, _mid)
Measure a source distance from a mid point as +/- 1.0 being he furhest distance the have been
Parameters:
_src (float): (float) Input value
_mid (float): (float) The mid point to Measure fron
릴리즈 노트
v8Added:
sqr(x)
Parameters:
x (float): (float) - The number to square
Returns: (float) - The square of the input value
atan2(dy, dx)
atan2 function
Parameters:
dy (float): (float) - The y-coordinate
dx (float): (float) - The x-coordinate
Returns: (float) - The angle in radians
scale(_src, _oldMin, _oldMax, _newMin, _newMax)
Scale to new values from old
Parameters:
_src (float): src Value
_oldMin (float): old Min Value
_oldMax (float): old Max Value
_newMin (float): new Min Value
_newMax (float): new Max Value
Returns: rescaled value
scale_stddev(_src, _length, scale)
Rescale values to fit within the std deviation range
Parameters:
_src (float): Value to convert
_length (int): Length of the std deviation
scale (float): (float) Scale factor
Returns: rescaled value
abs1(_src)
Modify incoming data to abs + 1
Parameters:
_src (float): Value to convert
Returns: rescaled value
Fraction
Fraction
Fields:
num (series int): (int) The numerator
den (series int): (int) The denominator
Updated:
toFraction(_source, _epsilon, _iterations)
Convert Decimal to tuple fraction Output, 1/0 resolves to [1,1]
note : it is suboptimal, will be updating with a much faster algorithm
Parameters:
_source (float)
_epsilon (int): (OPTIONAL) to precision (10e-N)
_iterations (int): Maximum iterations (OPTIONAL)
Returns: [num,den] Simplified Fraction (if negative, Numerator gets the sign)
auto_inv_pow(source, power)
Inverse power of a float based on digit count
Parameters:
source (float): (float) Input value
power (float): (float) (OPTIONAL) Power to raise to (default 1))
릴리즈 노트
v9릴리즈 노트
v10mild tidy
릴리즈 노트
v11minor optimizing, but huge improvement downstream for hsvColor speeds.
Added:
gcd(_numerator, _denominator)
Greatest Common Denom
Parameters:
_numerator (int): (int) Input fraction numerator
_denominator (int): (int) Input fraction dennominator
Returns: The Greatest commonm Denom
method sign(_src)
An Int sign value
Namespace types: series float, simple float, input float, const float
Parameters:
_src (float): The value in
Returns: The int aign
Updated:
simplifyFraction(_num, _den)
Simplify fraction to lowest form
Parameters:
_num (int): (int) Input fraction numerator
_den (int): (int) Input fraction dennominator
Returns: Simplified Fraction
pow10(_src, _pow)
Power of 10 scale up/down the decimal left or right
Parameters:
_src (float): Input value
_pow (int): Number of * 10 to perform
Returns: Value with decimal moved + right, - left
abs1(_src)
Modify incoming data to an abs val above 1, compressed at 1 (not linear)
Parameters:
_src (float): Value to convert
Returns: rescaled value
Removed:
gap(_value1, _value2)
Absolute distance between any two float values, agnostic to +/-
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.