PINE LIBRARY
업데이트됨 StrengthFactors

Library "StrengthFactors"
Strength factor calculations for various market analysis metrics
get_threshold(opt, input_val, avg_val, lineancy)
Calculate threshold based on options
Parameters:
opt (string): Threshold option ("Disabled", "User Input Threshold", "Average as Threshold")
input_val (float): User input threshold value
avg_val (float): Average value for threshold
lineancy (float): Lineancy adjustment percentage
Returns: Calculated threshold
get_percentage_of_threshold(value, threshold)
Calculate percentage of threshold
Parameters:
value (float): Current value
threshold (float): Threshold value
Returns: Percentage of threshold
get_distance_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Distance Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [distance_sf, distance_avg, distance_threshold, distance_prc_of_thr]
get_uniformity_sf(lookback, thr_opt, thr_inp, stddev_mult, lineancy)
Calculate Uniformity Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
stddev_mult (float): Standard deviation multiplier
lineancy (float): Lineancy adjustment
Returns: [uniformity_sf, uniformity_threshold, uniformity_prc_of_thr]
get_overlap_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Overlap Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [overlap_sf, overlap_avg, overlap_threshold, overlap_prc_of_thr]
get_body_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Body Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [body_sf, body_avg, body_threshold, body_prc_of_thr]
get_close_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Close Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [close_sf, close_avg, close_threshold, close_prc_of_thr]
get_breakout_sf(lookback, thr_opt, thr_inp, lineancy, bro_dir, is_inside_bar)
Calculate Breakout Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
bro_dir (int): Breakout direction
is_inside_bar (bool): Is inside bar flag
Returns: [breakout_sf, breakout_avg, breakout_threshold, breakout_prc_of_thr]
get_always_in_sf(thr_opt, thr_inp, lineancy)
Calculate Always-In Strength Factor
Parameters:
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [always_in_sf, always_in_avg, always_in_threshold, always_in_prc_of_thr]
get_directional_sf(overlap_prc, distance_prc, body_prc, close_prc, breakout_prc, lookback, thr_opt, thr_inp, lineancy)
Calculate Directional Strength Factor (composite)
Parameters:
overlap_prc (float): Overlap SF as percentage of threshold
distance_prc (float): Distance SF as percentage of threshold
body_prc (float): Body SF as percentage of threshold
close_prc (float): Close SF as percentage of threshold
breakout_prc (float): Breakout SF as percentage of threshold
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [directional_sf, directional_avg, directional_threshold, directional_prc_of_thr]
get_combined_direction_sf(body_prc, close_prc, breakout_prc, lookback, thr_opt, thr_inp, lineancy)
Calculate Combined Direction Strength Factor
Parameters:
body_prc (float): Body SF as percentage of threshold
close_prc (float): Close SF as percentage of threshold
breakout_prc (float): Breakout SF as percentage of threshold
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [combined_sf, combined_avg, combined_threshold, combined_prc_of_thr]
get_all_strength_factors(lookback, lineancy, dist_thr_opt, dist_thr_inp, body_thr_opt, body_thr_inp, close_thr_opt, close_thr_inp, breakout_thr_opt, breakout_thr_inp, bro_dir, is_inside_bar)
Get all strength factors at once (convenience function)
Parameters:
lookback (int): Lookback period for averages
lineancy (float): Lineancy adjustment percentage
dist_thr_opt (string): Distance threshold option
dist_thr_inp (float): Distance threshold input
body_thr_opt (string): Body threshold option
body_thr_inp (float): Body threshold input
close_thr_opt (string): Close threshold option
close_thr_inp (float): Close threshold input
breakout_thr_opt (string): Breakout threshold option
breakout_thr_inp (float): Breakout threshold input
bro_dir (int): Breakout direction
is_inside_bar (bool): Is inside bar flag
Returns: Map containing all strength factor results
Strength factor calculations for various market analysis metrics
get_threshold(opt, input_val, avg_val, lineancy)
Calculate threshold based on options
Parameters:
opt (string): Threshold option ("Disabled", "User Input Threshold", "Average as Threshold")
input_val (float): User input threshold value
avg_val (float): Average value for threshold
lineancy (float): Lineancy adjustment percentage
Returns: Calculated threshold
get_percentage_of_threshold(value, threshold)
Calculate percentage of threshold
Parameters:
value (float): Current value
threshold (float): Threshold value
Returns: Percentage of threshold
get_distance_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Distance Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [distance_sf, distance_avg, distance_threshold, distance_prc_of_thr]
get_uniformity_sf(lookback, thr_opt, thr_inp, stddev_mult, lineancy)
Calculate Uniformity Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
stddev_mult (float): Standard deviation multiplier
lineancy (float): Lineancy adjustment
Returns: [uniformity_sf, uniformity_threshold, uniformity_prc_of_thr]
get_overlap_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Overlap Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [overlap_sf, overlap_avg, overlap_threshold, overlap_prc_of_thr]
get_body_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Body Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [body_sf, body_avg, body_threshold, body_prc_of_thr]
get_close_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Close Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [close_sf, close_avg, close_threshold, close_prc_of_thr]
get_breakout_sf(lookback, thr_opt, thr_inp, lineancy, bro_dir, is_inside_bar)
Calculate Breakout Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
bro_dir (int): Breakout direction
is_inside_bar (bool): Is inside bar flag
Returns: [breakout_sf, breakout_avg, breakout_threshold, breakout_prc_of_thr]
get_always_in_sf(thr_opt, thr_inp, lineancy)
Calculate Always-In Strength Factor
Parameters:
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [always_in_sf, always_in_avg, always_in_threshold, always_in_prc_of_thr]
get_directional_sf(overlap_prc, distance_prc, body_prc, close_prc, breakout_prc, lookback, thr_opt, thr_inp, lineancy)
Calculate Directional Strength Factor (composite)
Parameters:
overlap_prc (float): Overlap SF as percentage of threshold
distance_prc (float): Distance SF as percentage of threshold
body_prc (float): Body SF as percentage of threshold
close_prc (float): Close SF as percentage of threshold
breakout_prc (float): Breakout SF as percentage of threshold
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [directional_sf, directional_avg, directional_threshold, directional_prc_of_thr]
get_combined_direction_sf(body_prc, close_prc, breakout_prc, lookback, thr_opt, thr_inp, lineancy)
Calculate Combined Direction Strength Factor
Parameters:
body_prc (float): Body SF as percentage of threshold
close_prc (float): Close SF as percentage of threshold
breakout_prc (float): Breakout SF as percentage of threshold
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
lineancy (float): Lineancy adjustment
Returns: [combined_sf, combined_avg, combined_threshold, combined_prc_of_thr]
get_all_strength_factors(lookback, lineancy, dist_thr_opt, dist_thr_inp, body_thr_opt, body_thr_inp, close_thr_opt, close_thr_inp, breakout_thr_opt, breakout_thr_inp, bro_dir, is_inside_bar)
Get all strength factors at once (convenience function)
Parameters:
lookback (int): Lookback period for averages
lineancy (float): Lineancy adjustment percentage
dist_thr_opt (string): Distance threshold option
dist_thr_inp (float): Distance threshold input
body_thr_opt (string): Body threshold option
body_thr_inp (float): Body threshold input
close_thr_opt (string): Close threshold option
close_thr_inp (float): Close threshold input
breakout_thr_opt (string): Breakout threshold option
breakout_thr_inp (float): Breakout threshold input
bro_dir (int): Breakout direction
is_inside_bar (bool): Is inside bar flag
Returns: Map containing all strength factor results
릴리즈 노트
v2Updated:
get_uniformity_sf(lookback, thr_opt, thr_inp, stddev_mult, lineancy)
Calculate Uniformity Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input
stddev_mult (float): Standard deviation multiplier
lineancy (float): Lineancy adjustment
Returns: [uniformity_sf, uniformity_avg, uniformity_threshold, uniformity_prc_of_thr]
릴리즈 노트
v3릴리즈 노트
v4Added:
get_breakout_direction(higH, loW, high_prev, low_prev)
Calculate breakout direction based on price action
Parameters:
higH (float): Current high
loW (float): Current low
high_prev (float): Previous high
low_prev (float): Previous low
Returns: [bro_dir, is_outside_bar, is_inside_bar] Breakout direction and bar type flags
Updated:
get_distance_sf(lookback, thr_opt, thr_inp, lineancy)
Calculate Distance Strength Factor
Parameters:
lookback (int): Lookback period for average
thr_opt (string): Threshold option
thr_inp (float): User threshold input (as multiplier of average)
lineancy (float): Lineancy adjustment
Returns: [distance_sf, distance_avg, distance_threshold, distance_prc_of_thr]
get_all_strength_factors(lookback, lineancy, dist_thr_opt, dist_thr_inp, uni_thr_opt, uni_thr_inp, uni_stddev_mult, ovl_thr_opt, ovl_thr_inp, body_thr_opt, body_thr_inp, close_thr_opt, close_thr_inp, breakout_thr_opt, breakout_thr_inp, bro_dir, is_inside_bar)
Get all strength factors at once (convenience function)
Parameters:
lookback (int): Lookback period for averages
lineancy (float): Lineancy adjustment percentage
dist_thr_opt (string): Distance threshold option
dist_thr_inp (float): Distance threshold input
uni_thr_opt (string): Uniformity threshold option
uni_thr_inp (float): Uniformity threshold input
uni_stddev_mult (float): Uniformity standard deviation multiplier
ovl_thr_opt (string): Overlap threshold option
ovl_thr_inp (float): Overlap threshold input
body_thr_opt (string): Body threshold option
body_thr_inp (float): Body threshold input
close_thr_opt (string): Close threshold option
close_thr_inp (float): Close threshold input
breakout_thr_opt (string): Breakout threshold option
breakout_thr_inp (float): Breakout threshold input
bro_dir (int): Breakout direction
is_inside_bar (bool): Is inside bar flag
Returns: Map containing all strength factor results
릴리즈 노트
v5파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.