PINE LIBRARY
已更新 NormalDistributionFunctions

Library "NormalDistributionFunctions"
The NormalDistributionFunctions library encompasses a comprehensive suite of statistical tools for financial market analysis. It provides functions to calculate essential statistical measures such as mean, standard deviation, skewness, and kurtosis, alongside advanced functionalities for computing the probability density function (PDF), cumulative distribution function (CDF), Z-score, and confidence intervals. This library is designed to assist in the assessment of market volatility, distribution characteristics of asset returns, and risk management calculations, making it an invaluable resource for traders and financial analysts.
meanAndStdDev(source, length)
Calculates and returns the mean and standard deviation for a given data series over a specified period.
Parameters:
source (float): float: The data series to analyze.
length (int): int: The lookback period for the calculation.
Returns: Returns an array where the first element is the mean and the second element is the standard deviation of the data series for the given period.
skewness(source, mean, stdDev, length)
Calculates and returns skewness for a given data series over a specified period.
Parameters:
source (float): float: The data series to analyze.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
length (int): int: The lookback period for the calculation.
Returns: Returns skewness value
kurtosis(source, mean, stdDev, length)
Calculates and returns kurtosis for a given data series over a specified period.
Parameters:
source (float): float: The data series to analyze.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
length (int): int: The lookback period for the calculation.
Returns: Returns kurtosis value
pdf(x, mean, stdDev)
pdf: Calculates the probability density function for a given value within a normal distribution.
Parameters:
x (float): float: The value to evaluate the PDF at.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
Returns: Returns the probability density function value for x.
cdf(x, mean, stdDev)
cdf: Calculates the cumulative distribution function for a given value within a normal distribution.
Parameters:
x (float): float: The value to evaluate the CDF at.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
Returns: Returns the cumulative distribution function value for x.
confidenceInterval(mean, stdDev, size, confidenceLevel)
Calculates the confidence interval for a data series mean.
Parameters:
mean (float): float: The mean of the data series.
stdDev (float): float: The standard deviation of the data series.
size (int): int: The sample size.
confidenceLevel (float): float: The confidence level (e.g., 0.95 for 95% confidence).
Returns: Returns the lower and upper bounds of the confidence interval.
The NormalDistributionFunctions library encompasses a comprehensive suite of statistical tools for financial market analysis. It provides functions to calculate essential statistical measures such as mean, standard deviation, skewness, and kurtosis, alongside advanced functionalities for computing the probability density function (PDF), cumulative distribution function (CDF), Z-score, and confidence intervals. This library is designed to assist in the assessment of market volatility, distribution characteristics of asset returns, and risk management calculations, making it an invaluable resource for traders and financial analysts.
meanAndStdDev(source, length)
Calculates and returns the mean and standard deviation for a given data series over a specified period.
Parameters:
source (float): float: The data series to analyze.
length (int): int: The lookback period for the calculation.
Returns: Returns an array where the first element is the mean and the second element is the standard deviation of the data series for the given period.
skewness(source, mean, stdDev, length)
Calculates and returns skewness for a given data series over a specified period.
Parameters:
source (float): float: The data series to analyze.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
length (int): int: The lookback period for the calculation.
Returns: Returns skewness value
kurtosis(source, mean, stdDev, length)
Calculates and returns kurtosis for a given data series over a specified period.
Parameters:
source (float): float: The data series to analyze.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
length (int): int: The lookback period for the calculation.
Returns: Returns kurtosis value
pdf(x, mean, stdDev)
pdf: Calculates the probability density function for a given value within a normal distribution.
Parameters:
x (float): float: The value to evaluate the PDF at.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
Returns: Returns the probability density function value for x.
cdf(x, mean, stdDev)
cdf: Calculates the cumulative distribution function for a given value within a normal distribution.
Parameters:
x (float): float: The value to evaluate the CDF at.
mean (float): float: The mean of the distribution.
stdDev (float): float: The standard deviation of the distribution.
Returns: Returns the cumulative distribution function value for x.
confidenceInterval(mean, stdDev, size, confidenceLevel)
Calculates the confidence interval for a data series mean.
Parameters:
mean (float): float: The mean of the data series.
stdDev (float): float: The standard deviation of the data series.
size (int): int: The sample size.
confidenceLevel (float): float: The confidence level (e.g., 0.95 for 95% confidence).
Returns: Returns the lower and upper bounds of the confidence interval.
發行說明
v2Added:
meanAndStdDevFiltered(condition, source, size)
Calculates average and standard deviation for filtered discontinuous data based on a condition.
Parameters:
condition (bool): (bool): A boolean condition to filter data for inclusion.
source (float): (float): The data point to consider for inclusion based on the condition.
size (int): (int): The maximum size of the data array; older data points are removed if exceeded.
Returns: : A tuple containing the average and standard deviation of the filtered data set.
calculateZScoreRange(mean, stdDev, zScore)
Calculates and returns the lower and upper bounds of a range based on the mean, standard deviation, and z-score.
Parameters:
mean (float): (float): The mean of the distribution.
stdDev (float): (float): The standard deviation of the distribution.
zScore (float): (float): The z-score representing the number of standard deviations from the mean.
Returns: Returns an array where the first element is the lower bound and the second element is the upper bound of the range.
Updated:
meanAndStdDev(source, length)
Calculates and returns the mean and standard deviation for a given data series over a specified period.
Parameters:
source (float): (float): The data series to analyze.
length (int): (int): The lookback period for the calculation.
Returns: Returns an array where the first element is the mean and the second element is the standard deviation of the data series for the given period.
skewness(source, mean, stdDev, length)
Calculates and returns skewness for a given data series over a specified period.
Parameters:
source (float): (float): The data series to analyze.
mean (float): (float): The mean of the distribution.
stdDev (float): (float): The standard deviation of the distribution.
length (int): (int): The lookback period for the calculation.
Returns: Returns skewness value
kurtosis(source, mean, stdDev, length)
Calculates and returns kurtosis for a given data series over a specified period.
Parameters:
source (float): (float): The data series to analyze.
mean (float): (float): The mean of the distribution.
stdDev (float): (float): The standard deviation of the distribution.
length (int): (int): The lookback period for the calculation.
Returns: Returns kurtosis value
pdf(x, mean, stdDev)
pdf: Calculates the probability density function for a given value within a normal distribution.
Parameters:
x (float): (float): The value to evaluate the PDF at.
mean (float): (float): The mean of the distribution.
stdDev (float): (float): The standard deviation of the distribution.
Returns: Returns the probability density function value for x.
cdf(x, mean, stdDev)
cdf: Calculates the cumulative distribution function for a given value within a normal distribution.
Parameters:
x (float): (float): The value to evaluate the CDF at.
mean (float): (float): The mean of the distribution.
stdDev (float): (float): The standard deviation of the distribution.
Returns: Returns the cumulative distribution function value for x.
confidenceInterval(mean, stdDev, size, confidenceLevel)
Calculates the confidence interval for a data series mean.
Parameters:
mean (float): (float): The mean of the data series.
stdDev (float): (float): The standard deviation of the data series.
size (int): (int): The sample size.
confidenceLevel (float): (float): The confidence level (e.g., 0.95 for 95% confidence).
Returns: Returns the lower and upper bounds of the confidence interval.
發行說明
v3Added:
zScore(x, mean, stdDev)
zScore: Calculates the Z-score for a given value.
Parameters:
x (float): (float): The value to calculate the Z-score for.
mean (float): (float): The mean of the data series.
stdDev (float): (float): The standard deviation of the data series.
Returns: Returns the Z-score of x.
發行說明
v4Updated to pine version=6
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。