Finantial Functions calculation on Open Price.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Finantial Functions calculation on Open Price.

Post by Quant » Mon Jun 15, 2015 9:13 am

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";

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Finantial Functions calculation on Open Price.

Post by Christopher » Tue Jun 16, 2015 8:14 am

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";
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply