Hi,
I don't know what I am doing wrong with settings for bollinger function properties because the LowBand color is not updated. The color is update in the same time with highband and with color of this.
I create a function with default properties, and after that assign new properties:
// set Bollinger function properties
TLineSeries* fSeries = Object->series;
TBollingerFunction* f = (TBollingerFunction*)fSeries->FunctionType;
fSeries->SeriesColor = clGreen;
fSeries->Pen->Style = psSolid;
fSeries->Pen->Width = 1;
fSeries->YValues->ValueSource = "Close";
f->Period = 14;
fSeries->FunctionType->Period = f->Period;
f->Deviation = 2;
f->Exponential = true;
f->LowBandPen->Color = clAqua;
f->LowBandPen->Style = psSolid;
fSeries->CheckDataSource();
Thanks for your help,
Cristina
Bollinger Color
H Cristina,
using the following code works fine here, could you please check if it works for you ? (appologies for Delphi code) :
using the following code works fine here, could you please check if it works for you ? (appologies for Delphi code) :
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
MySeries: TCandleSeries;
MyFunctionSeries: TLineSeries;
begin
Chart1.View3D := false;
MySeries:=TCandleSeries.Create(Self);
MySeries.ParentChart := Chart1;
// you must create second series for Bollinger
MyFunctionSeries := TLineSeries.Create(Chart1);
MyFunctionSeries.ParentChart := Chart1;
MyFunctionSeries.SetFunction(TBollingerFunction.Create(Chart1));
// connect original series to MyFunctionSeries
// now MyFunctionSeries will get it's (calculated) data from MySeries
MyFunctionSeries.DataSource := MySeries;
With (MyFunctionSeries.FunctionType as TBollingerFunction) do
begin
Deviation:=2;
Period:=14;
Exponential:=true;
LowBandPen.Style := psDash;
LowBandPen.Color := clnone;
end;
// populate date and refresh Bollinger function/series
MySeries.FillSampleValues(100);
MyFunctionSeries.CheckDataSource;
With (MyFunctionSeries.FunctionType as TBollingerFunction) do
begin
LowBandPen.Style := psSolid;
LowBandPen.Width := 2;
LowBandPen.Color := clAqua;
end;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi,
I think, my code is the same (in C++).
TBollingerFunction* f = (TBollingerFunction*)fSeries->FunctionType;
f->LowBandPen->Color = clAqua;
f->LowBandPen->Style = psSolid;
More than that when I read the lowbandpen color I read the right color.
But the series are drawn both with fSeries color (the parent series).
Thank you for your quick answer,
cristina
I think, my code is the same (in C++).
TBollingerFunction* f = (TBollingerFunction*)fSeries->FunctionType;
f->LowBandPen->Color = clAqua;
f->LowBandPen->Style = psSolid;
More than that when I read the lowbandpen color I read the right color.
But the series are drawn both with fSeries color (the parent series).
Thank you for your quick answer,
cristina
Hi cristina,
please try to change the order of the line in the code, this could be the cause. Try to post the lines where the lowbandpen color is changed after the CheckDataSource line.
please try to change the order of the line in the code, this could be the cause. Try to post the lines where the lowbandpen color is changed after the CheckDataSource line.
Pep Jorge
http://support.steema.com
http://support.steema.com