Hi,
How can I fill the area between Bollinger bands with some color or gradient? Something like Area chart style, but between two curves.
This is my code for drawing bollinger:
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line(tChart1);
Steema.TeeChart.Functions.Bollinger function = new Steema.TeeChart.Functions.Bollinger(tChart1);
string[] parameters = indicator.Parameters.Split(';');
function.Period = double.Parse(parameters[0]);
function.Deviation = double.Parse(parameters[1]);
line.Function = function;
line.DataSource = candleSeries1;
line.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
line.Brush.Color = indicator.IndicatorColor;
line.CheckDataSource();
Thanks,
Goran
Fill area between Bollinger bands
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Goran,
Yes, you can use SeriesBand tool for that, for example:
Yes, you can use SeriesBand tool for that, for example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Candle candleSeries1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
candleSeries1.FillSampleValues();
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Functions.Bollinger function = new Steema.TeeChart.Functions.Bollinger(tChart1.Chart);
//string[] parameters = indicator.Parameters.Split(';');
//function.Period = double.Parse(parameters[0]);
//function.Deviation = double.Parse(parameters[1]);
line.Function = function;
line.DataSource = candleSeries1;
line.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
//line.Brush.Color = indicator.IndicatorColor;
line.CheckDataSource();
Steema.TeeChart.Tools.SeriesBandTool seriesBand1 = new Steema.TeeChart.Tools.SeriesBandTool(tChart1.Chart);
seriesBand1.Series = tChart1[tChart1.Series.Count - 2];
seriesBand1.Series2 = tChart1[tChart1.Series.Count - 1];
seriesBand1.Gradient.Visible = true;
seriesBand1.Gradient.Transparency = 50;
}
Best Regards,
Narcís Calvet / 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 |