PINE LIBRARY
업데이트됨 lib_math

Library "lib_math"
a collection of functions calculating without history operator to avoid max_bars_back errors
mean(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return returns average/mean of value since last reset
vwap(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return returns vwap of value and volume since last reset
variance(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return returns variance of value since last reset
trend(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return [slope, correlation, stddev, y1 , y2] where slope is the trend direction, correlation is a measurement for how well the values fit to the trendline (positive means ), stddev is how far the values deviate from the trend, x1 would be the time where reset is true and x2 would be the current time
a collection of functions calculating without history operator to avoid max_bars_back errors
mean(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return returns average/mean of value since last reset
vwap(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return returns vwap of value and volume since last reset
variance(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return returns variance of value since last reset
trend(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return [slope, correlation, stddev, y1 , y2] where slope is the trend direction, correlation is a measurement for how well the values fit to the trendline (positive means ), stddev is how far the values deviate from the trend, x1 would be the time where reset is true and x2 would be the current time
릴리즈 노트
v2 upgrade to pine v6, added in_range and range_overlap methodsAdded:
in_range(value, max, min)
checks if a given value is within a range (max, min)
Parameters:
value (int)
max (int)
min (int)
in_range(max1, min1, max2, min2)
checks if a given range (max1, min1) is within another range (max2, min2)
Parameters:
max1 (int)
min1 (int)
max2 (int)
min2 (int)
range_overlap(max1, min1, max2, min2)
checks if a given range (max1, min1) overlaps another range (max2, min2)
Parameters:
max1 (int)
min1 (int)
max2 (int)
min2 (int)
릴리즈 노트
v3 added a couple of range mapping functionsAdded:
mapping_linear(x, max1, min1, max2, min2)
convert value in range A to value in range B
Parameters:
x (float): the input data series within range 1, to be mapped to range 2
max1 (float): the maximum value in range 1 (origin)
min1 (float): the minimum value in range 1 (origin)
max2 (float): the maximum value in range 2 (target)
min2 (float): the minimum value in range 2 (target)
mapping_sigmoid(x, speed_scale, upper_bound, lower_bound, center)
fully customizable version of mapping_sigmoid (upper, lower, center, range_ratio, speed). This version adjusts the lower range's speed for imbalanced upper/lower range sizes, so the slope before and after crossing the center stays the same
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
upper_bound (float): the maximum value for input values towards positive infinity
lower_bound (float): the minimum value for input values towards negative infinity
center (float): the center value
mapping_sigmoid_fast(x, speed_scale, range_size, center)
simplified version of mapping_sigmoid, no adjusted lower range speed, equal range size (center to edge, i.e. actually half range)
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
range_size (float): instead of defining separate upper_bound/lower_bound, we add this value above and below the center to get balanced range sizes
center (float): the center value
mapping_sigmoid_1_0_1(x, speed_scale)
simplified version of mapping_sigmoid, with a fixed output range -1 | 0 | 1
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
mapping_sigmoid_0_05_1(x, speed_scale)
simplified version of mapping_sigmoid, with a fixed output range 0 | 0,5 | 1
Parameters:
x (float)
speed_scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
mapping_sigmoid_upper_0_1(x, scale)
simplified version of mapping_sigmoid, with a fixed positive output range 0 | 1 (negative x inputs default to 0)
Parameters:
x (float)
scale (float): defines the slope of the sigmoid curve (how fast x values are approaching the bounds)
릴리즈 노트
v4 added functions for continous stddev and linreg calculationAdded:
stddev(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return stddev how far the values deviate from the trend
linreg(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return [slope, y1, y2, length] where slope is the trend direction, y1 is the value a time of reset, y2 is the value on the current bar, len is the x-length of the regression line
Updated:
trend(value, reset)
Parameters:
value (float): series to track
reset (bool): flag to reset tracking
return [slope, correlation, stddev, y1 , y2, len] where slope is the trend direction, correlation is a measurement for how well the values fit to the trendline (positive means ), stddev is how far the values deviate from the trend, y1 is the y-coordinate at trend line start, y2 is the y-coordinate at trend line end, len is the x-length of the trend line, x1 would be the time where reset is true and x2 would be the current time
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.