Search code examples
.netwinformschartsmicrosoft-chart-controlsdundas

How to plot TEMA indicator with Microsoft Chart Control


I've added two series: Series1 (CandeleStick), Series2 (Line). I've added points and the FinancialFormula:

 public Form1() {
            InitializeComponent();
            chart1.Series[0].Points.Add(24.00, 25.00, 25.00, 24.875);
            chart1.Series[0].Points.Add(23.625, 25.125, 24.00, 24.875);
            chart1.Series[0].Points.Add(26.25, 28.25, 26.75, 27.00);
            chart1.Series[0].Points.Add(26.50, 27.875, 26.875, 27.25);
            chart1.Series[0].Points.Add(26.375, 27.50, 27.375, 26.75);
            chart1.Series[0].Points.Add(25.75, 26.875, 26.75, 26.00);
            chart1.Series[0].Points.Add(25.75, 26.75, 26.125, 26.25);
            chart1.Series[0].Points.Add(25.75, 26.375, 26.375, 25.875);
            chart1.Series[0].Points.Add(24.875, 26.125, 26.00, 25.375);
            chart1.Series[0].Points.Add(25.125, 26.00, 25.625, 25.75);
            chart1.Series[0].Points.Add(25.875, 26.625, 26.125, 26.375);
            chart1.Series[0].Points.Add(26.25, 27.375, 26.25, 27.25);
            chart1.Series[0].Points.Add(26.875, 27.25, 27.125, 26.875);
            chart1.Series[0].Points.Add(26.375, 27.125, 27.00, 27.125);
            chart1.Series[0].Points.Add(26.75, 27.875, 26.875, 27.75);
            chart1.Series[0].Points.Add(26.75, 28.375, 27.50, 27.00);
            chart1.Series[0].Points.Add(26.875, 28.125, 27.00, 28.00);
            chart1.Series[0].Points.Add(26.25, 27.875, 27.75, 27.625);
            chart1.Series[0].Points.Add(27.50, 28.75, 27.75, 28.00);
            chart1.Series[0].Points.Add(25.75, 28.25, 28.00, 27.25);
            chart1.Series[0].Points.Add(26.375, 27.50, 27.50, 26.875);
            chart1.Series[0].Points.Add(25.75, 27.50, 26.375, 26.25);
            chart1.Series[0].Points.Add(24.75, 27.00, 26.50, 25.25);
            chart1.DataManipulator.IsStartFromFirst = true;
            chart1.DataManipulator.FinancialFormula(FinancialFormula.TripleExponentialMovingAverage, "5", "Series1:Y4", "Series2:Y");
        }

But I can't get the expected result. Just line on zero level. What I'm doing wrong?


Solution

  • Your data is actually there. You need to adjust Minimum and Maximum for your axis scale and also the axis used for each series: AxisY or AxisY2.

    enter image description here

    EDIT: For the sake of testing, if you just repeat your own price pattern:

    enter image description here