Contents 

Technical Analysis functions library for .NET
Trend Indicators
Advance/Decline Line
Aroon Down
Aroon Oscillator
Aroon Up
Bill Williams Profitunity
DEMA
Exponential Moving Average
Exponential Moving Average Difference
Exponential Moving Average Factor
Exponential Moving Average Factor Difference
Line Weighted Moving Average
Line Weighted Moving Average Difference
MACD
Moving Average
Moving Average Difference
Nicoski
Positive Negative Changes Difference
Qstick Indicator
TEMA
Volatility Indicators
Average True Range
Bollinger Band
Bollinger Band Percent
Breadth Advance/Decline
Bollinger Band Width
True Range
Volatility
Volatility Chaikin
Momentum Indicators
Acceleration
Accumulation/Distribution
Balance Of Power
CCI
Fosback Unchanged Issues
Hughes Breadth Index
McClellan Oscillator
McClellan Summation Index
Momentum
Morris Daily Pressure
OBV Oscillator
OBV with Average Volume
On Balance Volume
Performance
Price Oscillator Percent Difference
Price Oscillator Points Difference
RSI
Stochastic Oscillator
Weighted Close
Wilder RSI
Williams R
Market Strength Indicators
Average Of Volume ROC
Chaikin A/D Oscillator
Chaikin Money Flow
Ease Of Movement
Market Facilitation Index
Volume Oscillator Percent Difference
Volume Oscillator Points Difference
Support and Resistance Indicators
Envelope
Additional Functions
Basic Functions
Average Changes
Average Negative Changes
Average Positive Changes
Change
Cumulative Sum
High Value
Low Value
Mean
Median Price
Negative Changes
Negative Changes Sum
Percent Change
Positive Changes
Positive Changes Sum
Sum Lag
Typical Price
Statistical Functions
Correlation Coefficient
Covariance
Standard Deviation
Variance
All Functions
Order TA4.NET
System requirements
Contacts

TA4.Net Web Online Help

Prev Page Next Page

Correlation Coefficient

The correlation coefficient a concept from statistics is a measure of how well trends in the predicted values follow trends in the actual values in the past.  It is a measure of how well the predicted values from a forecast model "fit" with the real-life data.

The correlation coefficient is a number between 0 and 1.  If there is no relationship between the predicted values and the actual values the correlation coefficient is 0 or very low (the predicted values are no better than random numbers).  As the strength of the relationship between the predicted values and actual values increases so does the correlation coefficient.  A perfect fit gives a coefficient of 1.0.  Thus the higher the correlation coefficient the better.

Syntax:

Public Function CorrelationCoefficient(ByVal ACIn() As Double, ByVal BCIn() As Double, ByVal Lag As Long) As Double

Parameters:

  • ByVal ACIn() As Double
  • ByVal BCIn() As Double
  • ByVal Lag As Long

Back to list

 

Example:

 

    Dim TA4Net As New TA4Net.CTAFunctions("YOUR-REGISTRATION-CODE")

    Dim Result() As Double

    Dim CloseValues() As Double

    Dim OpenValues(,) As Double

 

    ' loading values to arrays

    CloseValues = GetCloseValues()

    OpenValues = GetOpenValues()

    ' calculating Technical Analysis function

    Result = TA4Net.CorrelationCoefficient(OpenValues, CloseValues, 14)