Page 1 of 1

Finantial Functions calculation on Open Price.

Posted: Mon Jun 15, 2015 9:13 am
by 16071129
Dear Steema,
I am using moving average function to plot weighted moving average. If my datasource series is OHLC then on which price this function get calculated ? I think its on Close price. What if i want to calculate Moving average on Open price or any other of OHLC.
Same thing I wanted to do with other finantial functions also.

Code: Select all

            Steema.TeeChart.Styles.Line tMovAvg = new Steema.TeeChart.Styles.Line();
            tChart1.Series.Add(tMovAvg);
            MovingAverage tMovingAverage = new MovingAverage();
            tMovingAverage.Weighted = true;
            tMovAvg.DataSource = tChart1.Series[(int)Graph.TChartMain_Series.TS_OHLC];
            tMovAvg.Function = tMovingAverage;
            tMovAvg.Title = "WMA";

Re: Finantial Functions calculation on Open Price.

Posted: Tue Jun 16, 2015 8:14 am
by Christopher
Quant -

You can use:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      Candle candle = new Candle(tChart1.Chart);
      candle.DownCloseColor = Color.White;
      candle.UpCloseColor = Color.White;
      candle.Pen.Visible = false;
      candle.FillSampleValues(200);

      Steema.TeeChart.Styles.Line tMovAvg = new Steema.TeeChart.Styles.Line();
      tChart1.Series.Add(tMovAvg);
      MovingAverage tMovingAverage = new MovingAverage();
      tMovingAverage.Weighted = true;
      tMovAvg.DataSource = candle;
      tMovAvg.Function = tMovingAverage;
      tMovAvg.Title = "WMA Open";
      tMovAvg.YValues.DataMember = "Open";

      Steema.TeeChart.Styles.Line tMovAvg1 = new Steema.TeeChart.Styles.Line();
      tChart1.Series.Add(tMovAvg1);
      MovingAverage tMovingAverage1 = new MovingAverage();
      tMovingAverage1.Weighted = true;
      tMovAvg1.DataSource = candle;
      tMovAvg1.Function = tMovingAverage;
      tMovAvg1.Title = "WMA High";
      tMovAvg1.YValues.DataMember = "High";
    }