com.steema.teechart.functions
Class MovingAverage

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.functions.Function
          extended by com.steema.teechart.functions.Moving
              extended by com.steema.teechart.functions.MovingAverage

public class MovingAverage
extends Moving

Title: MovingAverage class

Description: Moving Average Function

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL


Field Summary
 
Fields inherited from class com.steema.teechart.functions.Function
canUsePeriod, dPeriod, HideSourceList, noSourceRequired, series, SingleSource, updating
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Constructor Summary
MovingAverage()
           
MovingAverage(IBaseChart c)
           
 
Method Summary
 double calculate(Series sourceSeries, int firstIndex, int lastIndex)
          Performs function operation on SourceSeries series.
 java.lang.String getDescription()
          Gets descriptive text.
 boolean getWeighted()
          Calculates the Moving Average using the corresponding X point values when true.
 boolean getWeightedIndex()
          Calculates the Moving Average using the source points index as the "weight" when true.
 void setWeighted(boolean value)
          Set Weighted to true to calculate Moving Average using the corresponding X point values.
 void setWeightedIndex(boolean value)
          Calculates the Moving Average using the source points index as the "weight" when true.
 
Methods inherited from class com.steema.teechart.functions.Moving
doCalculation
 
Methods inherited from class com.steema.teechart.functions.Function
addFunctionXY, addPoints, calculateAllPoints, calculateByPeriod, calculateMany, calculatePeriod, clear, dispose, getPeriod, getPeriodAlign, getPeriodStyle, getSeries, newInstance, readResolve, recalculate, setPeriod, setPeriodAlign, setPeriodStyle, setSeries, valueList
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MovingAverage

public MovingAverage()

MovingAverage

public MovingAverage(IBaseChart c)
Method Detail

getWeighted

public boolean getWeighted()
Calculates the Moving Average using the corresponding X point values when true.
Default value: false

Returns:
boolean

setWeighted

public void setWeighted(boolean value)
Set Weighted to true to calculate Moving Average using the corresponding X point values.
Default value: false

Parameters:
value - boolean

getWeightedIndex

public boolean getWeightedIndex()
Calculates the Moving Average using the source points index as the "weight" when true.
Default value: false

Returns:
boolean

setWeightedIndex

public void setWeightedIndex(boolean value)
Calculates the Moving Average using the source points index as the "weight" when true.
Default value: false

Parameters:
value - boolean

calculate

public double calculate(Series sourceSeries,
                        int firstIndex,
                        int lastIndex)
Performs function operation on SourceSeries series.
First and Last parameters are ValueIndex of first and last point used in calculation.
You can override Calculate function to perform customized calculation on one SourceSeries.

Overrides:
calculate in class Function
Parameters:
sourceSeries - Series
firstIndex - int
lastIndex - int
Returns:
double

getDescription

public java.lang.String getDescription()
Gets descriptive text.

Overrides:
getDescription in class Function
Returns:
String