TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Quant
- Advanced
- Posts: 142
- Joined: Tue Dec 30, 2014 12:00 am
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
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";
}