How can I add a "null candle" to a TCandleSeries?
I have two CandleSeries on the same chart, but dates of two series are not synchronized. For example, I can have two date sequences like
1st series: ..., 1 sep, 2 sep, 5 sep, 6 sep, 7 sep, 8 sep, 9 sep, 12 sep, ...
2nd series: ..., 1 sep, 2 sep, [no val], [no val], [no val], 8 sep, 9 sep, 12 sep, ...
so I need to introduce some invisible candle in 2nd series to keep it synchronized with 1st series on the chart.
Any idea?
Thanks
Best regards
FM
TCandleSeries AddNull
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi FM,
You don't need to add null values to a TCandleSeries. If you add a candle for each specific date, 2nd series won't draw candles for the days that doesn't have data. The example below shows you that, Series2 has a gap from 5-Sept to 10-Sept and is still synchronized with Series1.
You don't need to add null values to a TCandleSeries. If you add a candle for each specific date, 2nd series won't draw candles for the days that doesn't have data. The example below shows you that, Series2 has a gap from 5-Sept to 10-Sept and is still synchronized with Series1.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
Randomize;
for i:=1 to 15 do
begin
Series1.AddCandle(EncodeDate( 2005, 9, i),random,random,random,random);
if ((i < 5) or (i > 10)) then
Series2.AddCandle(EncodeDate( 2005, 9, i),random,random,random,random);
end;
Series1.XValues.DateTime:=True;
end;
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 |