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
Release Notes
⋅
v2
Added: printLabelOnEveryBar(the) Prints a float series - the value of the series for the particular candle Parameters: the: float series to print Returns: void
Release Notes
⋅
v3
Added: printLabelOnSpecificBar_string(string) Prints a string on a specific bar Parameters: string: text to be printed and series int bar index Returns: void
Release Notes
⋅
v4
Added: 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()
Release Notes
⋅
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
Release Notes
⋅
v6
Added: 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()
Release Notes
⋅
v7
Added: 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
Release Notes
⋅
v8
Added: 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
Release Notes
⋅
v9
Added: 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
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_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
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