Dundas Chart for Windows Forms
FormulaFinancial(FinancialFormula,String) Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > DataManipulator Class > FormulaFinancial Method : FormulaFinancial(FinancialFormula,String) Method


formulaName
A FinancialFormula enumeration value that determines the technical analysis or time series formula to be used.
inputSeries
A string expression consisting of one or more series with optional data point values. Multiple "series:values" should be comma-separated (e.g. "Series1:Y,Series2:Y3"). If a Y-value is not specified the first value (Y) is used.

Applies a financial formula to Y-values of one or more series' data points. The input series are used to store the resulting data.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub FormulaFinancial( _
   ByVal formulaName As FinancialFormula, _
   ByVal inputSeries As String _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim formulaName As FinancialFormula
Dim inputSeries As String
 
instance.FormulaFinancial(formulaName, inputSeries)
C#  
public void FormulaFinancial( 
   FinancialFormula formulaName,
   string inputSeries
)

Parameters

formulaName
A FinancialFormula enumeration value that determines the technical analysis or time series formula to be used.
inputSeries
A string expression consisting of one or more series with optional data point values. Multiple "series:values" should be comma-separated (e.g. "Series1:Y,Series2:Y3"). If a Y-value is not specified the first value (Y) is used.

Example

This example demonstrates how to use the EaseOfMovement financial formula.  We assume that Series1 is populated with stock data (High, Low, Open and Close values). Series1 is also used to store the indicators in its first Y-values.

Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

' We must concatenate comma-separated strings into one String that
' ** represents input values to pass to the financial formula. In this case:
' **
' ** "Series1:Y" represents the high price.
' ** "Series1:Y2" represents the low price.
' ** "Series1:Y4" represents the close price.
' ** "Series2:Y" represents the volume.
' */

Dim inputValues As String = "Series1:Y,Series1:Y2,Series1:Y4,Series2:Y"

' Call the formula
chart1.DataManipulator.FormulaFinancial(FinancialFormula.EaseOfMovement, inputValues)

...
C# Copy Code
using Dundas.Charting.WinControl
...

/* We must concatenate comma-separated strings into one string that
** represents input values to pass to the financial formula. In this case:
**
** "Series1:Y" represents the high price.
** "Series1:Y2" represents the low price.
** "Series1:Y4" represents the close price.
** "Series2:Y" represents the volume.
*/
string inputValues = "Series1:Y,Series1:Y2,Series1:Y4,Series2:Y";

// Call the formula
chart1.DataManipulator.FormulaFinancial(FinancialFormula.EaseOfMovement, inputValues);

...

Remarks

This method applies a formula to Y-values of one or more series' data points, and the input series are used to store the resulting data. The first listed input value is used to store the first output value, the second input value is used to store the second output value, and so on. If the number of input values is less than the number of output values an exception will be thrown.

Each particular formula has certain requirements, which are listed in the formula topics located in the "Formula Reference" folder.

This particular function definition cannot be used for those formulas that must have a parameter argument specified (use another definition that takes a parameters argument).

To apply a formula and preserve the input series use another definition of this function that uses an output series parameter (outputSeries).

Note: If you are applying an averaging formula (e.g. Simple Moving Average) see the StartFromFirst property.

For an overview of how to apply a formula see the Using Financial Formulas  topic. For a detailed discussion on a particular formula see that formula's topic in the "Formula Reference" folder.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.