.netCHARTING v10.5 Documentation


dotnetCHARTING Namespace > FinancialEngine Class > CrossingSignal Method : CrossingSignal(Series,Int32,Int32,Int32) Method
An series where the first element is the closing price in the last trading period, the second term is the closing price in the previous trading period and so on.
An integer which represents the number of periods used over which the closing price is compared.
Determines the methods used for the evaluation of the moving average in accordance with the following key:
  1. 1 = Simple moving average
  2. 2 = Geometric moving average
  3. 3 = Linearly weighted moving average
  4. 4 = Exponentially Weighted Moving average within smoothing fact set to be 0.5.
The number of periods over which the moving average is considered.
CrossingSignal(Series,Int32,Int32,Int32) Method
Implements a general framework for producing trading signals based on the crossing of two Stochastics.
Syntax
'Declaration
 
Public Overloads Shared Function CrossingSignal( _
   ByVal s As Series, _
   ByVal noOfPeriods As Integer, _
   ByVal method As Integer, _
   ByVal lengthOfMA As Integer _
) As Series
'Usage
 
Dim s As Series
Dim noOfPeriods As Integer
Dim method As Integer
Dim lengthOfMA As Integer
Dim value As Series
 
value = FinancialEngine.CrossingSignal(s, noOfPeriods, method, lengthOfMA)
public static Series CrossingSignal( 
   Series s,
   int noOfPeriods,
   int method,
   int lengthOfMA
)

Parameters

s
An series where the first element is the closing price in the last trading period, the second term is the closing price in the previous trading period and so on.
noOfPeriods
An integer which represents the number of periods used over which the closing price is compared.
method
Determines the methods used for the evaluation of the moving average in accordance with the following key:
  1. 1 = Simple moving average
  2. 2 = Geometric moving average
  3. 3 = Linearly weighted moving average
  4. 4 = Exponentially Weighted Moving average within smoothing fact set to be 0.5.
lengthOfMA
The number of periods over which the moving average is considered.

Return Value

-1, 0, 1 - this method returns either -1, 0, 1 to indicate that either a sell, no action or buy signal was generated.
Remarks

Methodology

Buy when the Stochastic %K, crosses above the MA %D and sell when the Stochastic %K falls below the MA of Stochastic %D. Since this approach is prone to being whip-sawed we use two (general) Stochastics so that a MA of the %K Stochastic of the first Stochastic and an even more smoothed second Stochastic. In this case a sell signal is generated if the first (more sensitive) Stochastic cross below the second (smoothed) Stochastic, and a buy signal is generated if the first Stochastic crosses above the second Stochastic.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also