BCGSuite for MFC
CBCGPChartMAFormula

Detailed Description

The CBCGPChartMAFormula implements a formula that computes an output series as a moving average.

To use it just construct the object and call Create. The following sample demonstrates how to display a smoothed 14 period moving average applied to close prices of a stock series:

Copy
CBCGPChartStockSeries* pStockSeries = new CBCGPChartStockSeries(pChart, CBCGPBaseChartStockSeries::SST_CANDLE);
.....
CBCGPChartSeries* pCloseSeries = pStockSeries->GetChildSeries(CBCGPChartStockSeries::CHART_STOCK_SERIES_CLOSE_IDX);
int nMAPeriod = 14;
CBCGPChartMAFormula smoothed(CBCGPChartMAFormula::MA_SMOOTHED, nMAPeriod);
CBCGPChartSeries* pMASeries = smoothed.Create(pChart, _T("Smoothed MA"), pCloseSeries);

Note: Create returns a pointer to output series that can be used later to setup series appearance and other parameters.

+ Inheritance diagram for CBCGPChartMAFormula:

Public Member Functions

 CBCGPChartMAFormulaConstructs an MA formula object.
 
 GetMATypeReturns the current moving average types.
 
 SetMATypeSets moving average type.
 
- Public Member Functions inherited from CBCGPChartAdvancedFormula
 CreateCreates a formula.
 
 GeneratePointsCalled to generate data points for an output series.
 
 GetOutputSeriesCategoryReturns output series category.
 
 GetOutputSeriesTypeReturns output series type.
 
 GetPeriodReturns formula period.
 
 SetOutputSeriesCategorySets output series category.
 
 SetOutputSeriesTypeSets output series type.
 
 SetPeriodSets formula period.
 
 UpdateLastDataPointsUpdates last data points.
 
- Public Member Functions inherited from CBCGPChartBaseFormula
 FindInputSeriesIndexFinds input series index.
 
 GetInputSeriesAtReturns an input series located at the specified position.
 
 GetInputSeriesCountReturns the number of input series.
 
 GetLParamReturns user-defined data.
 
 GetParentSeriesReturns a pointer to a parent series.
 
 IsNonDiscreteCurveTells whether the formula is displayed as a non-discrete curve.
 
 SetLParamSets user-defined data.
 
 SetParentSeriesSets a parent series that represents a formula on the diagram.
 

Additional Inherited Members

- Public Attributes inherited from CBCGPChartAdvancedFormula
 m_bUseLongDataDefines how data points are added to the output series.