PINE LIBRARY
업데이트됨 UtilityFunctions

Library "UtilityFunctions"
Utility functions written by me
printLabelOnLastBar_string(string)
Prints string in a label on the last bar
Parameters:
string: value to print
Returns: void
printLabelOnLastBar_float(float)
Prints float in a label on the last bar
Parameters:
float: value to print
Returns: void
printSeriesInReverseOnLabels(series)
Prints a float series in labels in reverse (the first value is on the last candle, the second value is on the second to last candle, etc.)
Parameters:
series: float values to print
Returns: void
isPeriodDailyBased(string)
Returns true/false if the period is Daily based (1D, 3D, ...)
Parameters:
string: timeframe period
Returns: true/false
get_multiplier(string)
Gets the mutliplier of the timeframe passed compared to the current timeframe. If current TF is 5m and the passed timeframe period is 30m, the result will be 6
Parameters:
string: timeframe param
Returns: simple float of the multiplier
Utility functions written by me
printLabelOnLastBar_string(string)
Prints string in a label on the last bar
Parameters:
string: value to print
Returns: void
printLabelOnLastBar_float(float)
Prints float in a label on the last bar
Parameters:
float: value to print
Returns: void
printSeriesInReverseOnLabels(series)
Prints a float series in labels in reverse (the first value is on the last candle, the second value is on the second to last candle, etc.)
Parameters:
series: float values to print
Returns: void
isPeriodDailyBased(string)
Returns true/false if the period is Daily based (1D, 3D, ...)
Parameters:
string: timeframe period
Returns: true/false
get_multiplier(string)
Gets the mutliplier of the timeframe passed compared to the current timeframe. If current TF is 5m and the passed timeframe period is 30m, the result will be 6
Parameters:
string: timeframe param
Returns: simple float of the multiplier
릴리즈 노트
v2Added:
printLabelOnEveryBar(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
릴리즈 노트
v3Added:
printLabelOnSpecificBar_string(string)
Prints a string on a specific bar
Parameters:
string: text to be printed and series int bar index
Returns: void
릴리즈 노트
v4Added:
print_1_value_on_60_level_string()
print_1_value_on_60_level_float()
print_2_values_on_60_level_string()
print_2_values_on_60_level_float()
print_3_values_on_60_level_string()
print_3_values_on_60_level_float()
print_4_values_on_60_level_string()
print_4_values_on_60_level_float()
릴리즈 노트
v5 - added exported functions for the first time; will probably store more here, in order for them to be on only one place and to be able to apply them on many places more easily릴리즈 노트
v6Added:
func_strong_bullish_alignment_by_bar_index()
returns if at a specific index, the array value on it is above ema1, above ema2, above ema3
Returns: if at a specific index, the array value on it is above ema1, above ema2, above ema3
func_strong_bearish_alignment_by_bar_index()
returns if at a specific index, the array value on it is below ema1, below ema2, below ema3
Returns: if at a specific index, the array value on it is below ema1, below ema2, below ema3
func_turn_series_to_array()
func_get_bull_and_bear_cross_indexes(arr)
returns if source has strong bull/bear alignment compared to its emas and the bull/bear cross index if there is such - so if the emas are 20,45 and 200, if price is above 20 and 45 and these two emas are bullishly crossed, but
they are below 200, the index will be -1
Parameters:
arr: - the array of values (could be close values of candles, could be asset vs market (index) values), which basically contains the source; source is e.g. price close, or index; the emas are of the source
func_generate_price_data()
릴리즈 노트
v7Added:
func_generate_relative_strength_data()
func_cross_of_source_and_200_ema()
creates an array with the source values you pass as a parametr; starts counting from the most recent element (the element now) and continues backwards and checks if the source had
bullishly or bearishly crossed the ema200 parameter that was passed; also writes in the table myTable some values
Returns: bool- if the last index of crossing the source with the ema200 was a bull cross or not
릴리즈 노트
v8Added:
printLabelOnEveryBar_at_80_level(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
printLabelOnEveryBar_at_40_level(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
printLabelOnEveryBar_at_0_level(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
Removed:
printLabelOnEveryBar(the)
Prints a float series - the value of the series for the particular candle
릴리즈 노트
v9Added:
printLabelOnEveryBar_at_80_level_string(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
printLabelOnEveryBar_at_40_level_string(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
printLabelOnEveryBar_at_0_level_string(the)
Prints a float series - the value of the series for the particular candle
Parameters:
the: float series to print
Returns: void
릴리즈 노트
v10Added:
print_on_specific_x_at_specific_y_level_float()
print_on_specific_x_at_specific_y_level_string()
릴리즈 노트
v11Added:
print_on_specific_bar_index_on_candle_high_string()
print_on_specific_bar_index_on_candle_high_float()
릴리즈 노트
v12Added:
print_on_current_bar_index_on_candle_high_string()
print_on_current_bar_index_on_candle_high_float()
print_on_current_bar_index_on_candle_low_string()
print_on_current_bar_index_on_candle_low_float()
Removed:
print_on_specific_bar_index_on_candle_high_string()
print_on_specific_bar_index_on_candle_high_float()
릴리즈 노트
v13Added:
f_oscillator_resets(p_close, p_oscillator, p_should_draw_oscillator_pivot_vertical_arrows, p_should_draw_oscillator_pivots_connecting_lines, p_should_activate_log_mom_reading_bull, p_should_activate_hidden_div_bull, p_should_activate_regular_div_bull, p_should_activate_regular_bull_div_only_above_x_ema, p_above_x_ema_length, p_oscillator_reset_level_bull, p_should_activate_log_mom_reading_bear, p_should_activate_hidden_div_bear, p_should_activate_regular_div_bear, p_should_activate_regular_bear_div_only_below_x_ema, p_below_x_ema_length, p_oscillator_reset_level_bear)
Parameters:
p_close
p_oscillator
p_should_draw_oscillator_pivot_vertical_arrows
p_should_draw_oscillator_pivots_connecting_lines
p_should_activate_log_mom_reading_bull
p_should_activate_hidden_div_bull
p_should_activate_regular_div_bull
p_should_activate_regular_bull_div_only_above_x_ema
p_above_x_ema_length
p_oscillator_reset_level_bull
p_should_activate_log_mom_reading_bear
p_should_activate_hidden_div_bear
p_should_activate_regular_div_bear
p_should_activate_regular_bear_div_only_below_x_ema
p_below_x_ema_length
p_oscillator_reset_level_bear
print_2_values_with_their_keys_on_current_bar_index_on_candle_high_string(key1, val1, key2, val2)
Parameters:
key1
val1
key2
val2
print_2_values_with_their_keys_on_current_bar_index_on_candle_low_string(key1, val1, key2, val2)
Parameters:
key1
val1
key2
val2
릴리즈 노트
v14Added:
f_oscillator_resets_without_drawings(p_close, p_oscillator, p_should_activate_log_mom_reading_bull, p_should_activate_hidden_div_bull, p_should_activate_regular_div_bull, p_should_activate_regular_bull_div_only_above_x_ema, p_above_x_ema_length, p_oscillator_reset_level_bull, p_should_activate_log_mom_reading_bear, p_should_activate_hidden_div_bear, p_should_activate_regular_div_bear, p_should_activate_regular_bear_div_only_below_x_ema, p_below_x_ema_length, p_oscillator_reset_level_bear)
Parameters:
p_close
p_oscillator
p_should_activate_log_mom_reading_bull
p_should_activate_hidden_div_bull
p_should_activate_regular_div_bull
p_should_activate_regular_bull_div_only_above_x_ema
p_above_x_ema_length
p_oscillator_reset_level_bull
p_should_activate_log_mom_reading_bear
p_should_activate_hidden_div_bear
p_should_activate_regular_div_bear
p_should_activate_regular_bear_div_only_below_x_ema
p_below_x_ema_length
p_oscillator_reset_level_bear
릴리즈 노트
v15Added:
f_oscillator_resets_with_drawings(p_close, p_oscillator, p_should_draw_oscillator_pivot_vertical_arrows, p_should_draw_oscillator_pivots_connecting_lines, p_should_activate_log_mom_reading_bull, p_should_activate_hidden_div_bull, p_should_activate_regular_div_bull, p_should_activate_regular_bull_div_only_above_x_ema, p_above_x_ema_length, p_oscillator_reset_level_bull, p_should_activate_log_mom_reading_bear, p_should_activate_hidden_div_bear, p_should_activate_regular_div_bear, p_should_activate_regular_bear_div_only_below_x_ema, p_below_x_ema_length, p_oscillator_reset_level_bear)
Parameters:
p_close
p_oscillator
p_should_draw_oscillator_pivot_vertical_arrows
p_should_draw_oscillator_pivots_connecting_lines
p_should_activate_log_mom_reading_bull
p_should_activate_hidden_div_bull
p_should_activate_regular_div_bull
p_should_activate_regular_bull_div_only_above_x_ema
p_above_x_ema_length
p_oscillator_reset_level_bull
p_should_activate_log_mom_reading_bear
p_should_activate_hidden_div_bear
p_should_activate_regular_div_bear
p_should_activate_regular_bear_div_only_below_x_ema
p_below_x_ema_length
p_oscillator_reset_level_bear
Removed:
f_oscillator_resets(p_close, p_oscillator, p_should_draw_oscillator_pivot_vertical_arrows, p_should_draw_oscillator_pivots_connecting_lines, p_should_activate_log_mom_reading_bull, p_should_activate_hidden_div_bull, p_should_activate_regular_div_bull, p_should_activate_regular_bull_div_only_above_x_ema, p_above_x_ema_length, p_oscillator_reset_level_bull, p_should_activate_log_mom_reading_bear, p_should_activate_hidden_div_bear, p_should_activate_regular_div_bear, p_should_activate_regular_bear_div_only_below_x_ema, p_below_x_ema_length, p_oscillator_reset_level_bear)
릴리즈 노트
v16릴리즈 노트
v17Added:
f_is_bull_candle(p_open, p_close, i)
Parameters:
p_open
p_close
i
f_is_bear_candle(p_open, p_close, i)
Parameters:
p_open
p_close
i
릴리즈 노트
v18릴리즈 노트
v19Added:
empty()
Removed:
func_green_red_combo_new(p_price_ema1, p_price_ema2, p_fsr_ema1, p_fsr_ema2, p_fsr)
f_oscillator_resets_without_drawings(p_close, p_oscillator, p_should_activate_log_mom_reading_bull, p_should_activate_hidden_div_bull, p_should_activate_regular_div_bull, p_should_activate_regular_bull_div_only_above_x_ema, p_above_x_ema_length, p_oscillator_reset_level_bull, p_should_activate_log_mom_reading_bear, p_should_activate_hidden_div_bear, p_should_activate_regular_div_bear, p_should_activate_regular_bear_div_only_below_x_ema, p_below_x_ema_length, p_oscillator_reset_level_bear)
f_oscillator_resets_with_drawings(p_close, p_oscillator, p_should_draw_oscillator_pivot_vertical_arrows, p_should_draw_oscillator_pivots_connecting_lines, p_should_activate_log_mom_reading_bull, p_should_activate_hidden_div_bull, p_should_activate_regular_div_bull, p_should_activate_regular_bull_div_only_above_x_ema, p_above_x_ema_length, p_oscillator_reset_level_bull, p_should_activate_log_mom_reading_bear, p_should_activate_hidden_div_bear, p_should_activate_regular_div_bear, p_should_activate_regular_bear_div_only_below_x_ema, p_below_x_ema_length, p_oscillator_reset_level_bear)
func_strong_bullish_alignment_by_bar_index(arr, ema1, ema2, ema3, i)
returns if at a specific index, the array value on it is above ema1, above ema2, above ema3
func_strong_bearish_alignment_by_bar_index(arr, ema1, ema2, ema3, i)
returns if at a specific index, the array value on it is below ema1, below ema2, below ema3
func_turn_series_to_array(source)
func_get_bull_and_bear_cross_indexes(arr, source, ema1, ema2, ema3)
returns if source has strong bull/bear alignment compared to its emas and the bull/bear cross index if there is such - so if the emas are 20,45 and 200, if price is above 20 and 45 and these two emas are bullishly crossed, but
they are below 200, the index will be -1
func_generate_relative_strength_data(securityOfSymbolToCompare, securityOfComparedToSymbol)
func_cross_of_source_and_200_ema(source, ema200)
creates an array with the source values you pass as a parametr; starts counting from the most recent element (the element now) and continues backwards and checks if the source had
bullishly or bearishly crossed the ema200 parameter that was passed; also writes in the table myTable some values
func_generate_price_data(source)
print_2_values_with_their_keys_on_current_bar_index_on_candle_high_string(key1, val1, key2, val2)
print_2_values_with_their_keys_on_current_bar_index_on_candle_low_string(key1, val1, key2, val2)
print_on_current_bar_index_on_candle_high_string(txt)
print_on_current_bar_index_on_candle_high_float(txt)
print_on_current_bar_index_on_candle_low_string(txt)
print_on_current_bar_index_on_candle_low_float(txt)
print_on_specific_x_at_specific_y_level_float(x, y, txt)
print_on_specific_x_at_specific_y_level_string(x, y, txt)
printLabelOnLastBar_string(txt)
Prints string in a label on the last bar
printLabelOnLastBar_float(txt)
Prints float in a label on the last bar
printLabelOnEveryBar_at_80_level(float_series)
Prints a float series - the value of the series for the particular candle
printLabelOnEveryBar_at_40_level(float_series)
Prints a float series - the value of the series for the particular candle
printLabelOnEveryBar_at_0_level(float_series)
Prints a float series - the value of the series for the particular candle
printLabelOnEveryBar_at_80_level_string(string_series)
Prints a float series - the value of the series for the particular candle
printLabelOnEveryBar_at_40_level_string(string_series)
Prints a float series - the value of the series for the particular candle
printLabelOnEveryBar_at_0_level_string(string_series)
Prints a float series - the value of the series for the particular candle
printSeriesInReverseOnLabels(func_series)
Prints a float series in labels in reverse (the first value is on the last candle, the second value is on the second to last candle, etc.)
printLabelOnSpecificBar_string(txt, func_bar_index)
Prints a string on a specific bar
isPeriodDailyBased(tf_period)
Returns true/false if the period is Daily based (1D, 3D, ...)
get_multiplier(func_timeframe)
Gets the mutliplier of the timeframe passed compared to the current timeframe. If current TF is 5m and the passed timeframe period is 30m, the result will be 6
print_1_value_on_60_level_string(txt)
print_1_value_on_60_level_float(txt)
print_2_values_on_60_level_string(txt1, txt2)
print_2_values_on_60_level_float(txt1, txt2)
print_3_values_on_60_level_string(txt1, txt2, txt3)
print_3_values_on_60_level_float(txt1, txt2, txt3)
print_4_values_on_60_level_string(txt1, txt2, txt3, txt4)
print_4_values_on_60_level_float(txt1, txt2, txt3, txt4)
f_is_bull_candle(p_open, p_close, i)
f_is_bear_candle(p_open, p_close, i)
f_condition_was_met_was_less_than_x_hours_ago(p_condition, p_hours_ago)
f_condition_was_met_was_less_than_x_hours_ago_and_is_currently_true(p_condition, p_hours_ago)
f_condition_was_met_was_more_than_x_hours_ago(p_condition, p_hours_ago)
f_condition_was_met_was_more_than_x_hours_ago_and_is_currently_true(p_condition, p_hours_ago)
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.