Ejemplo n.º 1
0
void CDlgStock::test1()
{
	UpdateData(true);

	CFinancialTimeSeries stk;
	stk.Requery(m_strMarket + m_strLable, m_Time, m_Cycle, m_bCumDividendPrice, 10);

	// Charting
	m_ChartCtrl.EnableRefresh(FALSE);
	m_ChartCtrl.RemoveAllSeries();
	CChartStandardAxis* pBottomAxis = m_ChartCtrl.CreateStandardAxis(CChartCtrl::BottomAxis);
	CChartLogarithmicAxis* pLeftAxis = m_ChartCtrl.CreateLogarithmicAxis(CChartCtrl::LeftAxis);
	pBottomAxis->SetAutomatic(true);
	pBottomAxis->SetMinTickIncrement(1.0);
	pBottomAxis->SetTickLabelOrientationInDegree(45);
	pBottomAxis->SetMarginSize(false, 100);
	pLeftAxis->SetAutomatic(true);

	CChartCandlestickSerie *pCandles = m_ChartCtrl.CreateCandlestickSerie();
	for (auto &var : *stk.Data()) pCandles->AddPoint(var.time, var.open, var.high, var.low, var.close);

	pCandles->SetColor(RGB(0, 155, 100));
	pCandles->EnableShadow(false);
	
	m_ChartCtrl.EnableRefresh(TRUE);
	
	
}