MyLibrary_functions_D_S_3D_D_T_PART_1Library "MyLibrary_functions_D_S_3D_D_T_PART_1"
TODO: add library description here
color_(upcolor_txt, upcolor, dncolor_txt, dncolor, theme)
Parameters:
upcolor_txt (color)
upcolor (color)
dncolor_txt (color)
dncolor (color)
theme (string)
Source_Zigzag_F(Source)
Parameters:
Source (string)
p_lw_hg(Source_low, Source_high, Depth)
Parameters:
Source_low (float)
Source_high (float)
Depth (int)
lowing_highing(Source_low, Source_high, p_lw, p_hg, Deviation)
Parameters:
Source_low (float)
Source_high (float)
p_lw (int)
p_hg (int)
Deviation (int)
ll_lh(lowing, highing)
Parameters:
lowing (bool)
highing (bool)
down_ll_down_lh(ll, lh, Backstep)
Parameters:
ll (int)
lh (int)
Backstep (int)
down(down_ll, down_lh, lw, hg)
Parameters:
down_ll (bool)
down_lh (bool)
lw (int)
hg (int)
f_x_P_S123_lw(lw_, hg_, p_lw_, down, Source_low)
Parameters:
lw_ (int)
hg_ (int)
p_lw_ (int)
down (int)
Source_low (float)
f_x_P_S123_hg(lw_, hg_, p_hg_, down, Source_high)
Parameters:
lw_ (int)
hg_ (int)
p_hg_ (int)
down (int)
Source_high (float)
Update_lw_hg_last_l_last_h(lw, hg, last_l, last_h, p_lw, p_hg, down, Source_low, Source_high)
Parameters:
lw (int)
hg (int)
last_l (int)
last_h (int)
p_lw (int)
p_hg (int)
down (int)
Source_low (float)
Source_high (float)
x1_P_y1_P_x2_P_y2_P_x3_P_y3_P_x4_P_y4_P(lw, hg, last_l, last_h, Source)
Parameters:
lw (int)
hg (int)
last_l (int)
last_h (int)
Source (string)
x1_P_os(lw, hg, x2_D, Diverjence_MACD_Line_, Diverjence_MACD_Histagram_, Diverjence_RSI_, Diverjence_Stochastic_, Diverjence_volume_, Diverjence_CCI_, Diverjence_MFI_, Diverjence_Momentum_, Diverjence_OBV_, Diverjence_ADX_, MACD, hist_MACD, RSI, volume_ok, Stochastic_K, CCI, MFI, momentum, OBV, adx)
Parameters:
lw (int)
hg (int)
x2_D (int)
Diverjence_MACD_Line_ (bool)
Diverjence_MACD_Histagram_ (bool)
Diverjence_RSI_ (bool)
Diverjence_Stochastic_ (bool)
Diverjence_volume_ (bool)
Diverjence_CCI_ (bool)
Diverjence_MFI_ (bool)
Diverjence_Momentum_ (bool)
Diverjence_OBV_ (bool)
Diverjence_ADX_ (bool)
MACD (float)
hist_MACD (float)
RSI (float)
volume_ok (float)
Stochastic_K (float)
CCI (float)
MFI (float)
momentum (float)
OBV (float)
adx (float)
x3_P_os(lw, hg, x2_D, x4_D, Diverjence_MACD_Line_, Diverjence_MACD_Histagram_, Diverjence_RSI_, Diverjence_Stochastic_, Diverjence_volume_, Diverjence_CCI_, Diverjence_MFI_, Diverjence_Momentum_, Diverjence_OBV_, Diverjence_ADX_, MACD, hist_MACD, RSI, volume_ok, Stochastic_K, CCI, MFI, momentum, OBV, adx)
Parameters:
lw (int)
hg (int)
x2_D (int)
x4_D (int)
Diverjence_MACD_Line_ (bool)
Diverjence_MACD_Histagram_ (bool)
Diverjence_RSI_ (bool)
Diverjence_Stochastic_ (bool)
Diverjence_volume_ (bool)
Diverjence_CCI_ (bool)
Diverjence_MFI_ (bool)
Diverjence_Momentum_ (bool)
Diverjence_OBV_ (bool)
Diverjence_ADX_ (bool)
MACD (float)
hist_MACD (float)
RSI (float)
volume_ok (float)
Stochastic_K (float)
CCI (float)
MFI (float)
momentum (float)
OBV (float)
adx (float)
Err_test(lw, hg, x1, y1, x2, y2, y_d, start, finish, Err_Rate)
Parameters:
lw (int)
hg (int)
x1 (int)
y1 (float)
x2 (int)
y2 (float)
y_d (float)
start (int)
finish (int)
Err_Rate (float)
divergence_calculation(Feasibility_RD, Feasibility_HD, Feasibility_ED, lw, hg, Source_low, Source_high, x1_P_pr, x3_P_pr, x1_P_os, x3_P_os, x2_P_pr, x4_P_pr, oscillator, Fix_Err_Mid_Point_Pr, Fix_Err_Mid_Point_Os, Err_Rate_permissible_Mid_Line_Pr, Err_Rate_permissible_Mid_Line_Os, Number_of_price_periods_R_H, Permissible_deviation_factor_in_Pr_R_H, Number_of_oscillator_periods_R_H, Permissible_deviation_factor_in_OS_R_H, Number_of_price_periods_E, Permissible_deviation_factor_in_Pr_E, Number_of_oscillator_periods_E, Permissible_deviation_factor_in_OS_E)
Parameters:
Feasibility_RD (bool)
Feasibility_HD (bool)
Feasibility_ED (bool)
lw (int)
hg (int)
Source_low (float)
Source_high (float)
x1_P_pr (int)
x3_P_pr (int)
x1_P_os (int)
x3_P_os (int)
x2_P_pr (int)
x4_P_pr (int)
oscillator (float)
Fix_Err_Mid_Point_Pr (bool)
Fix_Err_Mid_Point_Os (bool)
Err_Rate_permissible_Mid_Line_Pr (float)
Err_Rate_permissible_Mid_Line_Os (float)
Number_of_price_periods_R_H (int)
Permissible_deviation_factor_in_Pr_R_H (float)
Number_of_oscillator_periods_R_H (int)
Permissible_deviation_factor_in_OS_R_H (float)
Number_of_price_periods_E (int)
Permissible_deviation_factor_in_Pr_E (float)
Number_of_oscillator_periods_E (int)
Permissible_deviation_factor_in_OS_E (float)
label_txt(label_ID, zigzag_Indicator_1_, zigzag_Indicator_2_, zigzag_Indicator_3_)
Parameters:
label_ID (string)
zigzag_Indicator_1_ (bool)
zigzag_Indicator_2_ (bool)
zigzag_Indicator_3_ (bool)
delet_scan_item_1(string_, NO_1, GAP)
Parameters:
string_ (string)
NO_1 (int)
GAP (int)
delet_scan_item_2(string_, NO_1, GAP)
Parameters:
string_ (string)
NO_1 (int)
GAP (int)
calculation_Final_total(MS_MN, Scan_zigzag_NO, zigzag_Indicator, zigzag_Indicator_1, zigzag_Indicator_2, zigzag_Indicator_3, LW_hg_P2, LW_hg_P1, lw_1, lw_2, lw_3, hg_1, hg_2, hg_3, lw_hg_D_POINT_ad_Array, lw_hg_D_POINT_id_Array, Array_Regular_MS, Array_Hidden_MS, Array_Exaggerated_MS, Array_Regular_MN, Array_Hidden_MN, Array_Exaggerated_MN)
Parameters:
MS_MN (string)
Scan_zigzag_NO (string)
zigzag_Indicator (bool)
zigzag_Indicator_1 (bool)
zigzag_Indicator_2 (bool)
zigzag_Indicator_3 (bool)
LW_hg_P2 (int)
LW_hg_P1 (int)
lw_1 (int)
lw_2 (int)
lw_3 (int)
hg_1 (int)
hg_2 (int)
hg_3 (int)
lw_hg_D_POINT_ad_Array (array)
lw_hg_D_POINT_id_Array (array)
Array_Regular_MS (array)
Array_Hidden_MS (array)
Array_Exaggerated_MS (array)
Array_Regular_MN (array)
Array_Hidden_MN (array)
Array_Exaggerated_MN (array)
Search_piote_1(array_id_7, scan_no)
Parameters:
array_id_7 (array)
scan_no (int)
Indicators and strategies
footpint_drovingLibrary "footpint_droving"
methods for printing all footprint objects
method print_droving(foot_bar, sup)
printing all footprint objects
Namespace types: footprint_type.Footprint_bar
Parameters:
foot_bar (Footprint_bar type from dboichenko/footprint_type/1) : instance of Footprint_bar type
sup (Support_objects type from dboichenko/footprint_type/1) : instance of Support_objects type
Returns: Void.
footprint_typeLibrary "footprint_type"
Contains all types for calculating and rendering footprints
Inputs
Inputs objects
Fields:
inbalance_percent (series int) : percentage coefficient to determine the Imbalance of price levels
stacked_input (series int) : minimum number of consecutive Imbalance levels required to draw extended lines
show_summary_footprint (series bool) : bool input for show summary footprint
procent_volume_area (series int) : definition size Value area
show_vah (series bool) : bool input for show VAH
show_poc (series bool) : bool input for show POC
show_val (series bool) : bool input for show VAL
color_vah (series color) : color VAH line
color_poc (series color) : color POC line
color_val (series color) : color VAL line
show_volume_profile (series bool)
new_imbalance_cond (series bool) : bool input for setup alert on new imbalance buy and sell
new_imbalance_line_cond (series bool) : bool input for setup alert on new imbalance line buy and sell
stop_past_imbalance_line_cond (series bool) : bool input for setup alert on stop past imbalance line buy and sell
Constants
Constants all Constants objects
Fields:
imbalance_high_char (series string) : char for printing buy imbalance
imbalance_low_char (series string) : char for printing sell imbalance
color_title_sell (series color) : color for footprint sell
color_title_buy (series color) : color for footprint buy
color_line_sell (series color) : color for sell line
color_line_buy (series color) : color for buy line
color_title_none (series color) : color None
Calculation_data
Calculation_data data for calculating
Fields:
detail_open (array) : array open from calculation timeframe
detail_high (array) : array high from calculation timeframe
detail_low (array) : array low from calculation timeframe
detail_close (array) : array close from calculation timeframe
detail_vol (array) : array volume from calculation timeframe
previos_detail_close (array) : array close from calculation timeframe
isBuyVolume (series bool) : attribute previosly bar buy or sell
Footprint_row
Footprint_row objects one footprint row
Fields:
price (series float) : row price
buy_vol (series float) : buy volume
sell_vol (series float) : sell volume
imbalance_buy (series bool) : attribute buy inbalance
imbalance_sell (series bool) : attribute sell imbalance
buy_vol_box (series box) : for ptinting buy volume
sell_vol_box (series box) : for printing sell volume
buy_vp_box (series box) : for ptinting volume profile buy
sell_vp_box (series box) : for ptinting volume profile sell
row_line (series label) : for ptinting row price
empty (series bool) : = true attribute row with zero volume buy and zero volume sell
Value_area
Value_area objects for calculating and printing Value area
Fields:
vah_price (series float) : VAH price
poc_price (series float) : POC price
val_price (series float) : VAL price
vah_label (series label) : label for VAH
poc_label (series label) : label for POC
val_label (series label) : label for VAL
vah_line (series line) : line for VAH
poc_level (series line) : line for POC
val_line (series line) : line for VAL
Imbalance_line_var_object
Imbalance_line_var_object var objects printing and calculation imbalance line
Fields:
cum_buy_line (array) : line array for saving all history buy imbalance line
cum_sell_line (array) : line array for saving all history sell imbalance line
Imbalance_line
Imbalance_line objects printing and calculation imbalance line
Fields:
buy_price_line (array) : float array for saving buy imbalance price level
sell_price_line (array) : float array for saving sell imbalance price level
var_imba_line (Imbalance_line_var_object) : var objects this type
Footprint_info_var_object
Footprint_info_var_object var objects for info printing
Fields:
cum_delta (series float) : var delta volume
cum_total (series float) : var total volume
cum_buy_vol (series float) : var buy volume
cum_sell_vol (series float) : var sell volume
cum_info (series table) : table for ptinting
Footprint_info
Footprint_info objects for info printing
Fields:
var_info (Footprint_info_var_object) : var objects this type
total (series label) : total volume
delta (series label) : delta volume
summary_label (series label) : label for ptinting
Footprint_bar
Footprint_bar all objects one bar with footprint
Fields:
foot_rows (array) : objects one row footprint
val_area (Value_area) : objects Value area
imba_line (Imbalance_line) : objects imbalance line
info (Footprint_info) : objects info - table,label and their variable
row_size (series float) : size rows
total_vol (series float) : total volume one footprint bar
foot_buy_vol (series float) : buy volume one footprint bar
foot_sell_vol (series float) : sell volume one footprint bar
foot_max_price_vol (map) : map with one value - price row with max volume buy + sell
calc_data (Calculation_data) : objects with detail data from calculation resolution
Support_objects
Support_objects support object for footprint calculation
Fields:
consts (Constants) : all consts objects
inp (Inputs) : all input objects
bar_index_show_condition (series bool) : calculation bool value for show all objects footprint
row_line_color (series color) : calculation value - color for row price
TUF_LOGICThe TUF_LOGIC library incorporates three-valued logic (also known as trilean logic) into Pine Script, enabling the representation of states beyond the binary True and False to include an 'Uncertain' state. This addition is particularly apt for financial market contexts where information may not always be black or white, accommodating scenarios of partial or ambiguous data.
Key Features:
Trilean Data Type: Defines a tri type, facilitating the representation of True (1), Uncertain (0), and False (-1) states, thus accommodating a more nuanced approach to logical evaluation.
Validation and Conversion: Includes methods like validate, to ensure trilean variables conform to expected states, and to_bool, for converting trilean to boolean values, enhancing interoperability with binary logic systems.
Core Logical Operations: Extends traditional logical operators (AND, OR, NOT, XOR, EQUALITY) to work within the trilean domain, enabling complex conditionals that reflect real-world uncertainties.
Specialized Logical Operations:
Implication Operators: Features IMP_K (Kleene's), IMP_L (Łukasiewicz's), and IMP_RM3, offering varied approaches to logical implication within the trilean framework.
Possibility, Necessity, and Contingency Operators: Implements MA ("it is possible that..."), LA ("it is necessary that..."), and IA ("it is unknown/contingent that..."), derived from Tarski-Łukasiewicz's modal logic attempts, enriching the library with modal logic capabilities.
Unanimity Functions: The UNANIMOUS operator assesses complete agreement among trilean values, useful for scenarios requiring consensus or uniformity across multiple indicators or conditions.
This library is developed to support scenarios in financial trading and analysis where decisions might hinge on more than binary outcomes. By incorporating modal logic aspects and providing a framework for handling uncertainty through the MA, LA, and IA operations, TUF_LOGIC bridges the gap between classical binary logic and the realities of uncertain information, making it a valuable tool for developing sophisticated trading strategies and analytical models.
Library "TUF_LOGIC"
3VL Implementation (TUF stands for True, Uncertain, False.)
method validate(self)
Ensures a valid trilean variable. This works by clamping the variable to the range associated with the trilean type.
Namespace types: tri
Parameters:
self (tri)
Returns: Validated trilean object.
method to_bool(self)
Converts a trilean object into a boolean object. True -> True, Uncertain -> na, False -> False.
Namespace types: tri
Parameters:
self (tri)
Returns: A boolean variable.
method NOT(self)
Negates the trilean object. True -> False, Uncertain -> Uncertain, False -> True
Namespace types: tri
Parameters:
self (tri)
Returns: Negated trilean object.
method AND(self, comparator)
Logical AND operation for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The first trilean object.
comparator (tri) : The second trilean object to compare with.
Returns: `tri` Result of the AND operation as a trilean object.
method OR(self, comparator)
Logical OR operation for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The first trilean object.
comparator (tri) : The second trilean object to compare with.
Returns: `tri` Result of the OR operation as a trilean object.
method EQUALITY(self, comparator)
Logical EQUALITY operation for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The first trilean object.
comparator (tri) : The second trilean object to compare with.
Returns: `tri` Result of the EQUALITY operation as a trilean object, True if both are equal, False otherwise.
method XOR(self, comparator)
Logical XOR (Exclusive OR) operation for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The first trilean object.
comparator (tri) : The second trilean object to compare with.
Returns: `tri` Result of the XOR operation as a trilean object.
method IMP_K(self, comparator)
Material implication using Kleene's logic for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The antecedent trilean object.
comparator (tri) : The consequent trilean object.
Returns: `tri` Result of the implication operation as a trilean object.
method IMP_L(self, comparator)
Logical implication using Łukasiewicz's logic for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The antecedent trilean object.
comparator (tri) : The consequent trilean object.
Returns: `tri` Result of the implication operation as a trilean object.
method IMP_RM3(self, comparator)
Logical implication using RM3 logic for trilean objects.
Namespace types: tri
Parameters:
self (tri) : The antecedent trilean object.
comparator (tri) : The consequent trilean object.
Returns: `tri` Result of the RM3 implication as a trilean object.
method MA(self)
Evaluates to True if the trilean object is either True or Uncertain, False otherwise.
Namespace types: tri
Parameters:
self (tri) : The trilean object to evaluate.
Returns: `tri` Result of the operation as a trilean object.
method LA(self)
Evaluates to True if the trilean object is True, False otherwise.
Namespace types: tri
Parameters:
self (tri) : The trilean object to evaluate.
Returns: `tri` Result of the operation as a trilean object.
method IA(self)
Evaluates to True if the trilean object is Uncertain, False otherwise.
Namespace types: tri
Parameters:
self (tri) : The trilean object to evaluate.
Returns: `tri` Result of the operation as a trilean object.
UNANIMOUS(self, comparator)
Evaluates the unanimity between two trilean values.
Parameters:
self (tri) : The first trilean value.
comparator (tri) : The second trilean value.
Returns: `tri` Returns True if both values are True, False if both are False, and Uncertain otherwise.
method UNANIMOUS(self)
Evaluates the unanimity among an array of trilean values.
Namespace types: array
Parameters:
self (array) : The array of trilean values.
Returns: `tri` Returns True if all values are True, False if all are False, and Uncertain otherwise.
tri
Three Value Logic (T.U.F.), or trilean. Can be True (1), Uncertain (0), or False (-1).
Fields:
v (series int) : Value of the trilean variable. Can be True (1), Uncertain (0), or False (-1).
LogLibrary "Log"
- Log methods that return input value for code readbility and cleaness.
method str(input)
str
Namespace types: series float, simple float, input float, const float
Parameters:
input (float)
method str(input)
str
Namespace types: series int, simple int, input int, const int
Parameters:
input (int)
method str(input)
str
Namespace types: series bool, simple bool, input bool, const bool
Parameters:
input (bool)
method str(input)
str
Namespace types: series string, simple string, input string, const string
Parameters:
input (string)
method str(input)
str
Namespace types: series linefill
Parameters:
input (linefill)
method str(input)
str
Namespace types: series line
Parameters:
input (line)
method str(input)
str
Namespace types: series box
Parameters:
input (box)
method str(input)
str
Namespace types: series label
Parameters:
input (label)
method str(input)
str
Namespace types: chart.point
Parameters:
input (chart.point)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: array
Parameters:
input (array)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
str
Namespace types: matrix
Parameters:
input (matrix)
method str(input)
Namespace types: matrix
Parameters:
input (matrix)
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: chart.point
Parameters:
input (chart.point) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series float, simple float, input float, const float
Parameters:
input (float) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series int, simple int, input int, const int
Parameters:
input (int) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series bool, simple bool, input bool, const bool
Parameters:
input (bool) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series string, simple string, input string, const string
Parameters:
input (string) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series linefill
Parameters:
input (linefill) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series line
Parameters:
input (line) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input value with the 'info' log level.
Namespace types: series box
Parameters:
input (box) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: series label
Parameters:
input (label) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input array with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: array
Parameters:
input (array) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Logs the input matrix with the 'info' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method info(input, msg)
Namespace types: matrix
Parameters:
input (matrix)
msg (string)
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: chart.point
Parameters:
input (chart.point) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series float, simple float, input float, const float
Parameters:
input (float) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series int, simple int, input int, const int
Parameters:
input (int) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series bool, simple bool, input bool, const bool
Parameters:
input (bool) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series string, simple string, input string, const string
Parameters:
input (string) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series linefill
Parameters:
input (linefill) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series line
Parameters:
input (line) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input value with the 'warning' log level.
Namespace types: series box
Parameters:
input (box) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: series label
Parameters:
input (label) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input array with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: array
Parameters:
input (array) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Logs the input matrix with the 'warning' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method warn(input, msg)
Namespace types: matrix
Parameters:
input (matrix)
msg (string)
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: chart.point
Parameters:
input (chart.point) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series float, simple float, input float, const float
Parameters:
input (float) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series int, simple int, input int, const int
Parameters:
input (int) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series bool, simple bool, input bool, const bool
Parameters:
input (bool) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series string, simple string, input string, const string
Parameters:
input (string) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series linefill
Parameters:
input (linefill) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series line
Parameters:
input (line) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input value with the 'error' log level.
Namespace types: series box
Parameters:
input (box) : The input value to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input value.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: series label
Parameters:
input (label) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input array with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input array.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: array
Parameters:
input (array) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Logs the input matrix with the 'error' log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
Returns: The input matrix.
method error(input, msg)
Namespace types: matrix
Parameters:
input (matrix)
msg (string)
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: chart.point
Parameters:
input (chart.point) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series float, simple float, input float, const float
Parameters:
input (float) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series int, simple int, input int, const int
Parameters:
input (int) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series bool, simple bool, input bool, const bool
Parameters:
input (bool) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series string, simple string, input string, const string
Parameters:
input (string) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series linefill
Parameters:
input (linefill) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series line
Parameters:
input (line) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input value with the specified log level.
Namespace types: series box
Parameters:
input (box) : The input value to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input value.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: series label
Parameters:
input (label) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input array with the specified log level.
Namespace types: array
Parameters:
input (array) : The input array to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input array.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: array
Parameters:
input (array) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Logs the input matrix with the specified log level.
Namespace types: matrix
Parameters:
input (matrix) : The input matrix to log.
msg (string) : The message to log. Default is an empty string.
level (int) : The log level (1 - info, 2 - warning, 3 - error). Default is 1.
Returns: The input matrix.
method log(input, msg, level)
Namespace types: matrix
Parameters:
input (matrix)
msg (string)
level (int)
DynamicFunctionsLibrary "DynamicFunctions"
Custom Dynamic functions that allow an adaptive calculation beginning from the first bar
RoC(src, period)
Dynamic RoC
Parameters:
src (float) : and period
Custom function to calculate the actual period considering non-na source values
period (int)
dynamicMedian(src, length)
Dynamic Median
Parameters:
src (float) : and length
length (int)
kernelRegression(src, bandwidth, kernel_type)
Dynamic Kernel Regression Calculation Uses either of the following inputs for kernel_type: Epanechnikov Logistic Wave
Parameters:
src (float)
bandwidth (int)
kernel_type (string)
waveCalculation(source, bandwidth, width)
Use together with kernelRegression function to get chart applicable band
Parameters:
source (float)
bandwidth (int)
width (float)
Rsi(src, length)
Dynamic RSI function
Parameters:
src (float)
length (int)
dynamicStdev(src, period)
Dynamic SD function
Parameters:
src (float)
period (int)
stdv_bands(src, length, mult)
Dynamic SD Bands
Parameters:
src (float)
length (int)
mult (float)
Returns: Basis, Positive SD, Negative SD
Adx(dilen, adxlen)
Dynamic ADX
Parameters:
dilen (int)
adxlen (int)
Returns: adx
Atr(length)
Dynamic ATR
Parameters:
length (int)
Returns: ATR
Macd(source, fastLength, slowLength, signalSmoothing)
Dynamic MACD
Parameters:
source (float)
fastLength (int)
slowLength (int)
signalSmoothing (int)
Returns: macdLine, signalLine, histogram
ZigZag Library [TradingFinder]🔵 Introduction
The "Zig Zag" indicator is an analytical tool that emerges from pricing changes. Essentially, it connects consecutive high and low points in an oscillatory manner. This method helps decipher price changes and can also be useful in identifying traditional patterns.
By sifting through partial price changes, "Zig Zag" can effectively pinpoint price fluctuations within defined time intervals.
🔵 Key Features
1. Drawing the Zig Zag based on Pivot points :
The algorithm is based on pivots that operate consecutively and alternately (switch between high and low swing). In this way, zigzag lines are connected from a swing high to a swing low and from a swing low to a swing high.
Also, with a very low probability, it is possible to have both low pivots and high pivots in one candle. In these cases, the algorithm tries to make the best decision to make the most suitable choice.
You can control what period these decisions are based on through the "PiPe" parameter.
2.Naming and labeling each pivot based on its position as "Higher High" (HH), "Lower Low" (LL), "Higher Low" (HL), and "Lower High" (LH).
Additionally, classic patterns such as HH, LH, LL, and HL can be recognized. All traders analyzing financial markets using classic patterns and Elliot Waves can benefit from the "zigzag" indicator to facilitate their analysis.
" HH ": When the price is higher than the previous peak (Higher High).
" HL ": When the price is higher than the previous low (Higher Low).
" LH ": When the price is lower than the previous peak (Lower High).
" LL ": When the price is lower than the previous low (Lower Low).
🔵 How to Use
First, you can add the library to your code as shown in the example below.
import TFlab/ZigZagLibrary_TradingFinder/1 as ZZ
Function "ZigZag" Parameters :
🟣 Logical Parameters
1. HIGH : You should place the "high" value here. High is a float variable.
2. LOW : You should place the "low" value here. Low is a float variable.
3. BAR_INDEX : You should place the "bar_index" value here. Bar_index is an integer variable.
4. PiPe : The desired pivot period for plotting Zig Zag is placed in this parameter. For example, if you intend to draw a Zig Zag with a Swing Period of 5, you should input 5.
PiPe is an integer variable.
Important :
Apart from the "PiPe" indicator, which is part of the customization capabilities of this indicator, you can create a multi-time frame mode for the indicator using 3 parameters "High", "Low" and "BAR_INDEX". In this way, instead of the data of the current time frame, use the data of other time frames.
Note that it is better to use the current time frame data, because using the multi-time frame mode is associated with challenges that may cause bugs in your code.
🟣 Setting Parameters
5. SHOW_LINE : It's a boolean variable. When true, the Zig Zag line is displayed, and when false, the Zig Zag line display is disabled.
6. STYLE_LINE : In this variable, you can determine the style of the Zig Zag line. You can input one of the 3 options: line.style_solid, line.style_dotted, line.style_dashed. STYLE_LINE is a constant string variable.
7. COLOR_LINE : This variable takes the input of the line color.
8. WIDTH_LINE : The input for this variable is a number from 1 to 3, which is used to adjust the thickness of the line that draws the Zig Zag. WIDTH_LINE is an integer variable.
9. SHOW_LABEL : It's a boolean variable. When true, labels are displayed, and when false, label display is disabled.
10. COLOR_LABEL : The color of the labels is set in this variable.
11. SIZE_LABEL : The size of the labels is set in this variable. You should input one of the following options: size.auto, size.tiny, size.small, size.normal, size.large, size.huge.
12. Show_Support : It's a boolean variable that, when true, plots the last support line, and when false, disables its plotting.
13. Show_Resistance : It's a boolean variable that, when true, plots the last resistance line, and when false, disables its plotting.
Suggestion :
You can use the following code snippet to import Zig Zag into your code for time efficiency.
//import Library
import TFlab/ZigZagLibrary_TradingFinder/1 as ZZ
// Input and Setting
// Zig Zag Line
ShZ = input.bool(true , 'Show Zig Zag Line', group = 'Zig Zag') //Show Zig Zag
PPZ = input.int(5 ,'Pivot Period Zig Zag Line' , group = 'Zig Zag') //Pivot Period Zig Zag
ZLS = input.string(line.style_dashed , 'Zig Zag Line Style' , options = , group = 'Zig Zag' )
//Zig Zag Line Style
ZLC = input.color(color.rgb(0, 0, 0) , 'Zig Zag Line Color' , group = 'Zig Zag') //Zig Zag Line Color
ZLW = input.int(1 , 'Zig Zag Line Width' , group = 'Zig Zag')//Zig Zag Line Width
// Label
ShL = input.bool(true , 'Label', group = 'Label') //Show Label
LC = input.color(color.rgb(0, 0, 0) , 'Label Color' , group = 'Label')//Label Color
LS = input.string(size.tiny , 'Label size' , options = , group = 'Label' )//Label size
Show_Support= input.bool(false, 'Show Last Support',
tooltip = 'Last Support' , group = 'Support and Resistance')
Show_Resistance = input.bool(false, 'Show Last Resistance',
tooltip = 'Last Resistance' , group = 'Support and Resistance')
//Call Function
ZZ.ZigZag(high ,low ,bar_index ,PPZ , ShZ ,ZLS , ZLC, ZLW ,ShL , LC , LS , Show_Support , Show_Resistance )
footprint_logicLibrary "footprint_logic"
Footprint logic getting internal buy/sell volume, inbalance...
get_buy_sell_volume(previos_close, tick_close, tick_high, tick_low, row_size, global_inbalance_high, global_inbalance_low, global_line_inbalance_high, global_line_inbalance_low, footprint_price, footprint_volume, tick_close_prev, level_group, tick_vol, stacked_input, inbalance_percent)
get global_buy_vol,global_sell_vol,level_volume_buy,level_volume_sell,level_inbalance_buy,level_inbalance_sell
Parameters:
previos_close (string)
tick_close (array)
tick_high (array)
tick_low (array)
row_size (float)
global_inbalance_high (array)
global_inbalance_low (array)
global_line_inbalance_high (array)
global_line_inbalance_low (array)
footprint_price (array)
footprint_volume (array)
tick_close_prev (array)
level_group (array)
tick_vol (array)
stacked_input (int)
inbalance_percent (int)
Returns: : float global_buy_vol,float global_sell_vol, level_volume_buy, level_volume_sell,map.new level_inbalance_buy,map.new level_inbalance_sell
Kernels©2024, GoemonYae; copied from @jdehorty's "KernelFunctions" on 2024-03-09 to ensure future dependency compatibility. Will also add more functions to this script.
Library "KernelFunctions"
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substition/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels.
rationalQuadratic(_src, _lookback, _relativeWeight, startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight (simple float) : Relative weighting of time frames. Smaller values resut in a more stretched out curve and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
startAtBar (simple int)
Returns: yhat The estimated values according to the Rational Quadratic Kernel.
gaussian(_src, _lookback, startAtBar)
Gaussian Kernel - A weighted average of the source series. The weights are determined by the Radial Basis Function (RBF).
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
startAtBar (simple int)
Returns: yhat The estimated values according to the Gaussian Kernel.
periodic(_src, _lookback, _period, startAtBar)
Periodic Kernel - The periodic kernel (derived by David Mackay) allows one to model functions which repeat themselves exactly.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Periodic Kernel.
locallyPeriodic(_src, _lookback, _period, startAtBar)
Locally Periodic Kernel - The locally periodic kernel is a periodic function that slowly varies with time. It is the product of the Periodic Kernel and the Gaussian Kernel.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Locally Periodic Kernel.
Liquidity Finder Library🔵 Introduction
You may intend to utilize the "Liquidity" detection capability in your indicators. Instead of writing it, you can import the "Liquidity Finder" library into your code. One of the advantages of this approach is time-saving and reduction in scripting errors.
🔵 Key Features
Identification of "Statics Liquidity"
Identification of "Dynamics Liquidity"
🔵 How to Use
Firstly, you can add the library to your code as shown in the example below :
import TFlab/LiquidityFinderLibrary/1 as Liq
The parameters of the "LLF" function are as follows :
sPP : A float variable ranging from 0 to 0.4. Increasing this number decreases the sensitivity of the "Statics Liquidity Line Detection" function and increases the number of detected lines. The default value is 0.3.
dPP : A float variable ranging from 0.4 to 1.95. Increasing this number increases the sensitivity of the "Dynamics Liquidity Line Detection" function and decreases the number of detected lines. The default value is 1.
SRs : An int variable. By default, it's set to 8. You can change this number to specify the periodicity of static liquidity pivot lines.
SRd : An int variable. By default, it's set to 3. You can change this number to specify the periodicity of dynamic liquidity pivot lines.
ShowHLLs : A bool variable. You can enable or disable the display of "High Statics Liquidity Line".
ShowLLLs : A bool variable. You can enable or disable the display of "Low Statics Liquidity Line".
ShowHLLd : A bool variable. You can enable or disable the display of "High Dynamics Liquidity Line".
ShowLLd : A bool variable. You can enable or disable the display of "High Dynamics Liquidity Line".
🟣Recommendation
You can use the following code snippet to import Liquidity Finder into your code for time-saving.
//import Library
import TFlab/LiquidityFinderLibrary/1 as Liq
//input
SLLS = input.float(0.30 , 'Statics Liquidity Line Sensitivity', maxval = 0.4 ,minval = 0.0, step = 0.01) // Statics Liquidity Line Sensitivity
DLLS = input.float(1.00 , 'Dynamics Liquidity Line Sensitivity', maxval = 1.95 ,minval = 0.4, step = 0.01) // Dynamics Liquidity Line Sensitivity
SPP = input.int(8 , 'Statics Period Pivot') // Statics Period Pivot
DPP = input.int(3 , 'Dynamics Period Pivot') // Dynamics Period Pivot
ShowSHLL = input.bool(true , 'Show Statics High Liquidity Line')
ShowSLLL = input.bool(true , 'Show Statics Low Liquidity Line')
ShowDHLL = input.bool(true , 'Show Dynamics High Liquidity Line')
ShowDLLL = input.bool(true , 'Show Dynamics Low Liquidity Line')
//call function
Liq.LLF(SPP,DPP,SLLS,DLLS,ShowSHLL,ShowSLLL,ShowDHLL,ShowDLLL)
azLibConnectorThe AzLibConnector provides a comprehensive suite of functions for facilitating seamless communication and chaining of signal value streams between connectable indicators, signal filters, monitors, and strategies on TradingView. By adeptly integrating both positive and negative weights from Entry Long (EL), Exit Long (XL), Entry Short (ES), and Exit Short (XS) signals into a singular figure, it leverages the source input field of TradingView to efficiently connect indicators in a chain. This results in a streamlined strategy setup without the necessity for Pine Script coding. Emphasizing modularity and uniformity, this library enables users to easily combine indicators into a coherent system, facilitating strategy development and execution with flexibility.
█ LIBRARY USAGE
extract(srcConnector)
Extract signals (EL, XL, ES, XS) from incoming connector signal stream
Parameters:
srcConnector : (series float) Source Connector. The connector stream series to extract the signals from.
Returns: A tuple containing the extracted EL, XL, ES, XS signal values.
compose(signalEL, signalXL, signalES, signalXS)
Compose a connector output signal stream from given EL, XL, ES and XS signals to be used by other Azullian Strategy Builder blocks.
Parameters:
signalEL : (series float) Entry Long signal value.
signalXL : (series float) Exit Long signal value.
signalES : (series float) Entry Short signal value.
signalXS : (series float) Exit Short signal value.
Returns: (series float) A composed connector output signal stream.
█ USAGE OF CONNECTABLE INDICATORS
■ Connectable chaining mechanism
Connectable indicators can be connected directly to the monitor, signal filter or strategy , or they can be daisy chained to each other while the last indicator in the chain connects to the monitor, signal filter or strategy. When using a signal filter or monitor you can chain the filter to the strategy input to make your chain complete.
• Direct chaining: Connect an indicator directly to the monitor, signal filter or strategy through the provided inputs (→).
• Daisy chaining: Connect indicators using the indicator input (→). The first in a daisy chain should have a flow (⌥) set to 'Indicator only'. Subsequent indicators use 'Both' to pass the previous weight. The final indicator connects to the monitor, signal filter, or strategy.
■ Set up the signal filter with a connectable indicator and strategy
Let's connect the MACD to a connectable signal filter and a strategy :
1. Load all relevant indicators
• Load MACD / Connectable
• Load Signal filter / Connectable
• Load Strategy / Connectable
2. Signal Filter: Connect the MACD to the Signal Filter
• Open the signal filter settings
• Choose one of the five input dropdowns (1→, 2→, 3→, 4→, 5→) and choose : MACD / Connectable: Signal Connector
• Toggle the enable box before the connected input to enable the incoming signal
3. Signal Filter: Update the filter settings if needed
• The default filter mode for the trading direction is SWING, and is compatible with the default settings in the strategy and indicators.
4. Signal Filter: Update the weight threshold settings if needed
• All connectable indicators load by default with a score of 6 for each direction (EL, XL, ES, XS)
• By default, weight threshold is 'ABOVE' Threshold 1 (TH1) and Threshold 2 (TH2), both set at 5. This allows each occurrence to score, as the default score is 1 point above the threshold.
5. Strategy: Connect the strategy to the signal filter in the strategy settings
• Select a strategy input → and select the Signal filter: Signal connector
6. Strategy: Enable filter compatible directions
• As the default setting of the filter is SWING, we should also set the SM (Strategy mode) to SWING.
Now that everything is connected, you'll notice green spikes in the signal filter or signal monitor representing long signals, and red spikes indicating short signals. Trades will also appear on the chart, complemented by a performance overview. Your journey is just beginning: delve into different scoring mechanisms, merge diverse connectable indicators, and craft unique chains. Instantly test your results and discover the potential of your configurations. Dive deep and enjoy the process!
█ BENEFITS
• Adaptable Modular Design: Arrange indicators in diverse structures via direct or daisy chaining, allowing tailored configurations to align with your analysis approach.
• Streamlined Backtesting: Simplify the iterative process of testing and adjusting combinations, facilitating a smoother exploration of potential setups.
• Intuitive Interface: Navigate TradingView with added ease. Integrate desired indicators, adjust settings, and establish alerts without delving into complex code.
• Signal Weight Precision: Leverage granular weight allocation among signals, offering a deeper layer of customization in strategy formulation.
• Advanced Signal Filtering: Define entry and exit conditions with more clarity, granting an added layer of strategy precision.
• Clear Visual Feedback: Distinct visual signals and cues enhance the readability of charts, promoting informed decision-making.
• Standardized Defaults: Indicators are equipped with universally recognized preset settings, ensuring consistency in initial setups across different types like momentum or volatility.
• Reliability: Our indicators are meticulously developed to prevent repainting. We strictly adhere to TradingView's coding conventions, ensuring our code is both performant and clean.
█ COMPATIBLE INDICATORS
Each indicator that incorporates our open-source 'azLibConnector' library and adheres to our conventions can be effortlessly integrated and used as detailed above.
For clarity and recognition within the TradingView platform, we append the suffix ' / Connectable' to every compatible indicator.
█ COMMON MISTAKES
• Removing an indicator from a chain: Deleting a linked indicator and confirming the "remove study tree" alert will also remove all underlying indicators in the object tree. Before removing one, disconnect the adjacent indicators and move it to the object stack's bottom.
• Point systems: The azLibConnector provides 500 points for each direction (EL: Enter long, XL: Exit long, ES: Enter short, XS: Exit short) Remember this cap when devising a point structure.
• Flow misconfiguration: In daisy chains the first indicator should always have a flow (⌥) setting of 'indicator only' while other indicator should have a flow (⌥) setting of 'both'.
█ A NOTE OF GRATITUDE
Through years of exploring TradingView and Pine Script, we've drawn immense inspiration from the community's knowledge and innovation. Thank you for being a constant source of motivation and insight.
█ RISK DISCLAIMER
Azullian's content, tools, scripts, articles, and educational offerings are presented purely for educational and informational uses. Please be aware that past performance should not be considered a predictor of future results.
LTI_FiltersLinear Time-Invariant (LTI) filters are fundamental tools in signal processing that operate with consistent behavior over time and linearly respond to input signals. They are crucial for analyzing and manipulating signals in various applications, ensuring the output signal's integrity is maintained regardless of when an input is applied or its magnitude. The Windowed Sinc filter is a specific type of LTI filter designed for digital signal processing. It employs a Sinc function, ideal for low-pass filtering, truncated and shaped within a finite window to make it practically implementable. This process involves multiplying the Sinc function by a window function, which tapers off towards the ends, making the filter finite and suitable for digital applications. Windowed Sinc filters are particularly effective for tasks like data smoothing and removing unwanted frequency components, balancing between sharp cutoff characteristics and minimal distortion. The efficiency of Windowed Sinc filters in digital signal processing lies in their adept use of linear algebra, particularly in the convolution process, which combines input data with filter coefficients to produce the desired output. This mathematical foundation allows for precise control over the filtering process, optimizing the balance between filtering performance and computational efficiency. By leveraging linear algebra techniques such as matrix multiplication and Toeplitz matrices, these filters can efficiently handle large datasets and complex filtering tasks, making them invaluable in applications requiring high precision and speed, such as audio processing, financial signal analysis, and image restoration.
Library "LTI_Filters"
offset(length, enable)
Calculates the time offset required for aligning the output of a filter with its input, based on the filter's length. This is useful for centered filters where the output is naturally shifted due to the filter's operation.
Parameters:
length (simple int) : The length of the filter.
enable (simple bool) : A boolean flag to enable or dissable the offset calculation.
Returns: The calculated offset if enabled; otherwise, returns 0.
lti_filter(filter_type, source, length, prefilter, centered, fc, window_type)
General-purpose Linear Time-Invariant (LTI) filter function that can apply various filter types to a data series. Can be used to apply a variety of LTI filters with different characteristics to financial data series or other time series data.
Parameters:
filter_type (simple string) : Specifies the type of filter. ("Sinc", "SMA", "WMA")
source (float) : The input data series to filter.
length (simple int) : The length of the filter.
prefilter (simple bool) : Boolean indicating whether to prefilter the input data.
centered (simple bool) : Determines whether the filter coefficients are centered.
fc (simple float) : Filter cutoff. Expressed like a length.
window_type (simple string) : Type of window function to apply. ("Hann", "Hamming", "Blackman", "Triangular", "Lanczos", "None")
Returns: The filtered data series.
lti_sma(source, length, prefilter)
Applies a Simple Moving Average (SMA) filter to the data series. Useful for smoothing data series to identify trends or for use as a component in more complex indicators.
Parameters:
source (float) : The input data series to filter.
length (simple int) : The length of the SMA filter.
prefilter (simple bool) : Boolean indicating whether to prefilter the input data.
Returns: The SMA-filtered data series.
lti_wma(source, length, prefilter, centered)
Applies a Weighted Moving Average (WMA) filter to a data series. Ideal for smoothing data with emphasis on more recent values, allowing for dynamic adjustments to the weighting scheme.
Parameters:
source (float) : The input data series to filter.
length (simple int) : The length of the WMA filter.
prefilter (simple bool) : Boolean indicating whether to prefilter the input data.
centered (simple bool) : Determines whether the filter coefficients are centered.
Returns: The WMA-filtered data series.
lti_sinc(source, length, prefilter, centered, fc, window_type)
Applies a Sinc filter to a data series, optionally using a window function. Particularly useful for signal processing tasks within financial analysis, such as smoothing or trend identification, with the ability to fine-tune filter characteristics.
Parameters:
source (float) : The input data series to filter.
length (simple int) : The length of the Sinc filter.
prefilter (simple bool) : Boolean indicating whether to prefilter the input data.
centered (simple bool) : Determines whether the filter coefficients are centered.
fc (simple float) : Filter cutoff. Expressed like a length.
window_type (simple string) : Type of window function to apply. ("Hann", "Hamming", "Blackman", "Triangular", "Lanczos", "None")
Returns: The Sinc-filtered data series.
support_array_methodsLibrary "support_array_methods"
Contains methods for support work with arrays:
1. unic
description: delete duplicate element from array
param _array: array for delete duplicate. Support types: int,float,string,bool
return: duplicate-free array
ZigZag LibraryThis is yet another ZigZag library.
🔵 Key Features
1. Lightning-Fast Performance : Optimized code ensures minimal lag and swift chart updates.
2. Real-Time Swing Detection : No more waiting for swings to finalize! This library continuously identifies the latest swing formation.
3. Amplitude-Aware : Discover significant swings earlier, even if they haven't reached the standard bar length.
4. Customizable Visualization : Draw ZigZag on-demand using polylines for a tailored analysis experience.
Stay tuned for more features as this library is being continuously enhanced. For the latest updates, please refer to the release information.
🔵 API
// Import this library. Remember to check the latest version of this library and replace the version number below.
import algotraderdev/zigzag/1 as zz
// Initialize the ZigZag instance.
var zz.ZigZag zig = zz.ZigZag.new().init(
zz.Settings.new(
swingLen = 5,
lineColor = color.blue,
lineStyle = line.style_solid,
lineWidth = 1))
// Analyze the ZigZag using the latest bar's data.
zig.tick()
// Draw the ZigZag.
if barstate.islast
zig.draw()
Chess_Data_5This library supplies a randomized list of 1-Move Chess Puzzles, this is 5/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_4This library supplies a randomized list of 1-Move Chess Puzzles, this is 4/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_3This library supplies a randomized list of 1-Move Chess Puzzles, this is 3/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_2This library supplies a randomized list of 1-Move Chess Puzzles, this is 2/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
Chess_Data_1This library supplies a randomized list of 1-Move Chess Puzzles, this is 1/5 in my collection of puzzles on Tradingview.
This library contains 730 chess puzzles, this is enough for 1 unique chess puzzle for 2 years (730/365 = 2)
The Puzzles are sourced from Lichess's open-source database found here -> | database.lichess.org
This data has been reduced to only included 1-Move chess puzzles with a popularity rating of > 70, and condensed for ease of formatting and less characters.
The reduced format of the data in this library reads:
"Puzzle Code, Modified FEN, Moves, Puzzle Rating, Popularity Rating"
Puzzle Code: Lichess Codes Identifying each puzzle, this allows them to be retrieved from their website based on this Code.
Modified FEN: Forsyth-Edwards Notation is the standard notation to describe positions of a chess game. This includes the active move tacked onto the end after the last '/', this simplifies the process to retrieve the active move in PineScript.
Moves: This holds the first move seen by the player in the puzzle (opposite color), and then the correct next move which is Puzzle Solution, that the player is trying to determine.
Puzzle Rating: Difficulty Rating of the Puzzle, Generally speaking | Under 1500 = Beginner | 1500 to 1800 Casual | 1800 to 2100 Intermediate | 2100+ Advanced
Popularity Ranking: This is the popularity ranking calculated by lichess based on their own data of user feedback.
Note: After Reducing the amount of data down to only 1-Move puzzles with a popularity rating of > 70%, there is still around 340k puzzles. (Enough for over 900 Years!)
> Functions [/b
get()
Returns the list of chess puzzle data.
HT: Functions LibLibrary "Functions"
is_date_equal(date1, date2, time_zone)
Parameters:
date1 (int)
date2 (int)
time_zone (string)
is_date_equal(date1, date2_str, time_zone)
Parameters:
date1 (int)
date2_str (string)
time_zone (string)
is_date_between(date_, start_year, start_month, end_year, end_month, time_zone_)
Parameters:
date_ (int)
start_year (int)
start_month (int)
end_year (int)
end_month (int)
time_zone_ (string)
is_time_equal(time1, time2_str, time_zone)
Parameters:
time1 (int)
time2_str (string)
time_zone (string)
is_time_equal(time1, time2, time_zone)
Parameters:
time1 (int)
time2 (int)
time_zone (string)
is_time_between(time_, start_hour, start_minute, end_hour, end_minute, time_zone_)
Parameters:
time_ (int)
start_hour (int)
start_minute (int)
end_hour (int)
end_minute (int)
time_zone_ (string)
is_time_between(time_, start_time, end_time, time_zone_)
Parameters:
time_ (int)
start_time (string)
end_time (string)
time_zone_ (string)
is_close(value, level, ticks)
Parameters:
value (float)
level (float)
ticks (int)
is_inrange(value, lb, hb)
Parameters:
value (float)
lb (float)
hb (float)
is_above(value, level, ticks)
Parameters:
value (float)
level (float)
ticks (int)
is_below(value, level, ticks)
Parameters:
value (float)
level (float)
ticks (int)
HT: Levels LibLibrary "Levels"
method initialize(id)
Namespace types: levels_collection
Parameters:
id (levels_collection)
method create_level(id, name, value, level_start_bar, level_color, show)
Namespace types: levels_collection
Parameters:
id (levels_collection)
name (string)
value (float)
level_start_bar (int)
level_color (color)
show (bool)
method set_level(id, name, value, level_start_bar, show)
Namespace types: levels_collection
Parameters:
id (levels_collection)
name (string)
value (float)
level_start_bar (int)
show (bool)
method find_resistance(id)
Namespace types: levels_collection
Parameters:
id (levels_collection)
method find_support(id)
Namespace types: levels_collection
Parameters:
id (levels_collection)
method draw_level(id)
Namespace types: level_info
Parameters:
id (level_info)
method draw_all_levels(id)
Namespace types: levels_collection
Parameters:
id (levels_collection)
level_info
Fields:
name (series__string)
value (series__float)
bar_num (series__integer)
level_line (series__line)
line_start_bar (series__integer)
level_color (series__color)
show (series__bool)
ss (series__bool)
sr (series__bool)
levels_collection
Fields:
levels (array__|level_info|#OBJ)
Word_Puzzle_Data_R2ZLibrary "Word_Puzzle_Data_R2Z"
This Library consists of functions for returning arrays of words starting with R through Z.
By splitting the data through multiple libraries, I can import more tokens into my final compiled script, so having this data separately is extremely helpful.
This library is the the container 1/3 for my database of 5 Letter words uses in my "Word Puzzle" Game.
The List was Obtained from this master list| gist.github.com
The list was also filtered for profanity.
If there were more than 999 words under 1 first letter, then I have made the array for the 1 letter into 2. 'letter1' & 'letter2', these are used for the letters "P, B, & S".
All words are lowercase
r_ary()
- Returns an array of words starting with "R"
s1_ary()
- Returns an array of words starting with "S"
s2_ary()
- Returns an array of words starting with "S"
t_ary()
- Returns an array of words starting with "T"
u_ary()
- Returns an array of words starting with "U"
v_ary()
- Returns an array of words starting with "V"
w_ary()
- Returns an array of words starting with "W"
x_ary()
- Returns an array of words starting with "X"
y_ary()
- Returns an array of words starting with "Y"
z_ary()
- Returns an array of words starting with "Z"
Word_Puzzle_Data_I2QLibrary "Word_Puzzle_Data_I2Q"
This Library consists of functions for returning arrays of words starting with I through Q.
By splitting the data through multiple libraries, I can import more tokens into my final compiled script, so having this data separately is extremely helpful.
This library is the the container 1/3 for my database of 5 Letter words uses in my "Word Puzzle" Game.
The List was Obtained from this master list| gist.github.com
The list was also filtered for profanity.
If there were more than 999 words under 1 first letter, then I have made the array for the 1 letter into 2. 'letter1' & 'letter2', these are used for the letters "P, B, & S".
All words are lowercase
i_ary()
- Returns an array of words starting with "I"
j_ary()
- Returns an array of words starting with "J"
k_ary()
- Returns an array of words starting with "K"
l_ary()
- Returns an array of words starting with "L"
m_ary()
- Returns an array of words starting with "M"
n_ary()
- Returns an array of words starting with "N"
o_ary()
- Returns an array of words starting with "O"
p1_ary()
- Returns an array of words starting with "P"
p2_ary()
- Returns an array of words starting with "P"
q_ary()
- Returns an array of words starting with "Q"