BCGSuite for MFC
void CBCGPChartStockSeries::SetCustomStockValueCallback ( BCGPCHART_STOCK_CALLBACK  pfn,
BOOL  bRedraw = FALSE 
)

Sets a callback to calculate custom stock values.

Set a callback to calculate custom stock values if you need to display a line chart based on custom stock values (calculated at the application level from the real stock data).

It can be useful if you do not derive a class from CBCGPChartStockSeries, but have to display the stock chart as a line based on custom values. The callback implementation may look like this:

Copy
CBCGPChartValue CALLBACK ChartStockCallbackFunc(int nDataPointIndex, CBCGPChartStockSeries* pSeries)
{
CBCGPChartStockData data = pSeries->GetStockDataAt(nDataPointIndex);
return CBCGPChartValue((data.m_dblHigh + data.m_dblLow) / 2);
}
void CChartStockView::OnInitialUpdate()
{
// stock chart setup....
pStockSeries->SetCustomStockValueCallback(ChartStockCallbackFunc);
}
Parameters
pfnA pointer to a callback.
bRedrawTRUE - redraw the chart immediately