I added a Bollinger function to a candle series on my TChart .Net chart --
When I uncheck the Bollinger series from the chart legend only the Top Bollinger line disappears - but the bottom line remains...
Aren't both Bollinger supposed to disappear?
Thanks in advance for your help.
Bollinger Function Leaves Bottom Line when Unselected
Re: Bollinger Function Leaves Bottom Line when Unselected
No reply so what I did was improvise --
I debugged and found that after a price is added to a Bollinger Function Series it creates a new unnamed series that has .ShowInLegend set to false and has a title of fastLine2. So after adding data to a Bollinger Series I do this:
line_tcBollingerID.CheckDataSource()
If TChart1.Series(TChart1.Series.Count - 1).ShowInLegend = False Then
TChart1.Series(TChart1.Series.Count - 1).Title = "BollingerI_L"
TChart1.Series(TChart1.Series.Count - 1).ShowInLegend = True
End If
Then I can toggle the series visibility from the legend because both of it's lines are in legend now.
If there's a built-in way I'd like to know.
I debugged and found that after a price is added to a Bollinger Function Series it creates a new unnamed series that has .ShowInLegend set to false and has a title of fastLine2. So after adding data to a Bollinger Series I do this:
line_tcBollingerID.CheckDataSource()
If TChart1.Series(TChart1.Series.Count - 1).ShowInLegend = False Then
TChart1.Series(TChart1.Series.Count - 1).Title = "BollingerI_L"
TChart1.Series(TChart1.Series.Count - 1).ShowInLegend = True
End If
Then I can toggle the series visibility from the legend because both of it's lines are in legend now.
If there's a built-in way I'd like to know.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Bollinger Function Leaves Bottom Line when Unselected
Hello,
Apologies for the delay in response to your question. Possibly the easiest 'built-in' way to achieve this is as the following:
Apologies for the delay in response to your question. Possibly the easiest 'built-in' way to achieve this is as the following:
Code: Select all
Candle series;
FastLine data;
Bollinger func;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
series = new Candle(tChart1.Chart);
func = new Bollinger(tChart1.Chart);
data = new FastLine(tChart1.Chart);
data.Function = func;
data.DataSource = series;
series.FillSampleValues();
tChart1.Legend.CheckBoxes = true;
tChart1.BeforeDraw += TChart1_BeforeDraw;
}
private void TChart1_BeforeDraw(object sender, Graphics3D g)
{
func.LowBand.Visible = data.Visible;
}
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 |
Re: Bollinger Function Leaves Bottom Line when Unselected
Ahhhh! - Much better -- thanks so much!
Joseph
Joseph