PINE LIBRARY

regressionUtilities

Actualizado
Library "regressionUtilities"

get_linear_regression(bar_index_array, prices_array, stdDev_mult)
  : Generates the linear regression channel for an array of values.
  Parameters:
    bar_index_array (array<int>): (array<int>): Array with bar indexes
    prices_array (array<float>): (array<float>): Array with prices
    stdDev_mult (float): (float): Standard deviation multiple for the channels
  Returns: : Returns x1, x2, y1_mid, y2_mid, y1_up, y2_up, y1_dn, y2_dn, m, b, R2, stdDev

get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
  Returns: : Returns three line objects

get_cuadratic_Regression(x_array, y_array, bars_to_project)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    x_array (array<int>): (array<int>): Maximum bar length
    y_array (array<float>): (array<float>): Minimum bar length
    bars_to_project (int): (int): Array with prices
  Returns: : Returns three line objects
Notas de prensa
v2

Added:
get_cuadratic_regression(x_array, y_array, bars_to_project)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    x_array (array<float>): (array<int>): Maximum bar length
    y_array (array<float>): (array<float>): Minimum bar length
    bars_to_project (int): (int): Array with prices
  Returns: : Returns three line objects

Removed:
get_cuadratic_Regression(x_array, y_array, bars_to_project)
  : Gets the best fitting linear regression using optimum length
Notas de prensa
v3
Notas de prensa
v4
Notas de prensa
v5

Updated:
get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
    show_data_table (bool): (bool): Activates and shows the data table
    tableYpos (string)
    tableXpos (string)
    table_textSize (string)
  Returns: : Returns three line objects
Notas de prensa
v6

Updated:
get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
    show_data_table (bool): (bool): Activates and shows the data table
    tableYpos (string)
    tableXpos (string)
    table_textSize (string)
  Returns: : Returns three line objects for the channel, plus the optimal length and maximum r2
Notas de prensa
v7
Notas de prensa
v8
Notas de prensa
v9
Notas de prensa
v10

Updated:
get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize, barsToRight, plot_labels, include_levels)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
    show_data_table (bool): (bool): Activates and shows the data table
    tableYpos (string)
    tableXpos (string)
    table_textSize (string)
    barsToRight (int)
    plot_labels (bool)
    include_levels (bool)
  Returns: : Returns three line objects for the channel, plus the optimal length and maximum r2
Notas de prensa
v11

Updated:
get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
    show_data_table (bool): (bool): Activates and shows the data table
    tableYpos (string)
    tableXpos (string)
    table_textSize (string)
  Returns: : Returns three line objects for the channel, plus the optimal length and maximum r2
Notas de prensa
v12

Added:
get_regressionChannel_data(max_length, min_length, source, stdDev_mult, plot_regression, plot_labels, bars_to_right, include_levels)
  : Gets and plots the data for the linear regression channel
  Parameters:
    max_length (int): (int): Maximum length for the linear regression.
    min_length (int): (int): Minimum length for the linear regression.
    source (float): (float): Source for the linear regression
    stdDev_mult (float): (float): Multiple for the standar deviations for the linear regression channel.
    plot_regression (bool): (bool): Plots the linear regression.
    plot_labels (bool): (bool): Plots the labels for the linear regression.
    bars_to_right (int): (int): Defines the number of bars to the right for the labels.
    include_levels (bool): (bool): Includes the levels in the labels.
  Returns: : Returns a maps with the regression levels, the direction flag and the datatable map.

Updated:
get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize, barsToRight, plot_labels, include_levels)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
    show_data_table (bool): (bool): Activates and shows the data table
    tableYpos (string)
    tableXpos (string)
    table_textSize (string)
    barsToRight (int)
    plot_labels (bool)
    include_levels (bool)
  Returns: : Returns three line objects for the channel, plus the optimal length and maximum r2
Notas de prensa
v13
Notas de prensa
v14
Notas de prensa
v15

Updated:
get_regressionChannel_data(max_length, min_length, source, stdDev_mult)
  : Gets and plots the data for the linear regression channel
  Parameters:
    max_length (int): (int): Maximum length for the linear regression.
    min_length (int): (int): Minimum length for the linear regression.
    source (float): (float): Source for the linear regression
    stdDev_mult (float): (float): Multiple for the standar deviations for the linear regression channel.
  Returns: : Returns a maps with the regression levels, the direction flag and the datatable map.
Notas de prensa
v16

Updated:
get_regressionChannel_data(max_length, min_length, source, stdDev_mult, plot_linearRegression, plot_labels, include_levels)
  : Gets data for the linear regression channel
  Parameters:
    max_length (int): (int): Maximum length for the linear regression.
    min_length (int): (int): Minimum length for the linear regression.
    source (float): (float): Source for the linear regression
    stdDev_mult (float): (float): Multiple for the standar deviations for the linear regression channel.
    plot_linearRegression (bool)
    plot_labels (bool)
    include_levels (bool)
  Returns: : Returns a maps with the regression levels, the direction flag and the datatable map.
Notas de prensa
v17
Notas de prensa
v18

Updated:
get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize, barsToRight, plot_labels, include_levels)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    max_length (int): (int): Maximum bar length
    min_length (int): (int): Minimum bar length
    source (float): (float): Source for the regression
    stdDev_mult (float): (float): Array with prices
    show_data_table (bool): (bool): Activates and shows the data table
    tableYpos (string)
    tableXpos (string)
    table_textSize (string)
    barsToRight (int)
    plot_labels (bool)
    include_levels (bool)
  Returns: : Returns three line objects that conform the regression channel, plus the optimal length and maximum r2
Notas de prensa
v19
Notas de prensa
v20

Updated:
get_cuadratic_regression(x_array, y_array, bars_to_project, max_length)
  : Gets the best fitting linear regression using optimum length
  Parameters:
    x_array (array<float>): (array<int>): Maximum bar length
    y_array (array<float>): (array<float>): Minimum bar length
    bars_to_project (int): (int): Array with prices
    max_length (int)
  Returns: : Returns three line objects
Notas de prensa
v21
Notas de prensa
v22
Notas de prensa
v23
Notas de prensa
v24

Updated:
get_regressionChannel_data(max_length, min_length, source, stdDev_mult, plot_linearRegression, plot_labels, include_levels, barsToRight)
  : Gets data for the linear regression channel
  Parameters:
    max_length (int): (int): Maximum length for the linear regression.
    min_length (int): (int): Minimum length for the linear regression.
    source (float): (float): Source for the linear regression
    stdDev_mult (float): (float): Multiple for the standar deviations for the linear regression channel.
    plot_linearRegression (bool)
    plot_labels (bool)
    include_levels (bool)
    barsToRight (int)
  Returns: : Returns a maps with the regression levels, the direction flag and the datatable map.
Notas de prensa
v25
Notas de prensa
v26
Notas de prensa
v27
strategies

Biblioteca Pine

Siguiendo fielmente el espíritu TradingView, el autor ha publicado este código Pine como una biblioteca de código abierto, permitiendo que otros programadores de Pine en nuestra comunidad lo utilicen de nuevo. ¡Olé por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero tenga en cuenta que la reutilización de este código en una publicación se rige por las Normas internas.


También en:

Exención de responsabilidad