first and last index of for instance HIGH function
Posted: Thu May 04, 2023 1:14 pm
I cant access the series that is a function, only series1.
Code: Select all
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TCandleSeries;
Series2: TFastLineSeries;
TeeFunction1: THighTeeFunction;
Series3: TFastLineSeries;
TeeFunction2: TLowTeeFunction;
ChartListBox1: TChartListBox;
procedure GoToTeechart(sender: TObject; DataId: Integer; RealTimeDataElement: TIABRealTimeData);
procedure GoToTeechartHistory(Sender: TObject; DataId, Item, Count: Integer; HistoricalChartDataElement: TIABHistoricalChartData);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
num:integer;
implementation
{$R *.dfm}
procedure tform1.GoToTeechart(Sender: TObject; DataId: Integer; RealTimeDataElement: TIABRealTimeData);
var
Open,High,Low,Close: Double;
first1,last1,first2,last2:integer;
tid:tdatetime;
begin
tid:=realtimedataelement.DateTime;
Open:=RealTimeDataElement.Open;
High:=RealTimeDataElement.High;
Low:=RealTimeDataElement.Low;
Close:=RealTimeDataElement.Close;
Chart1.LeftAxis.Maximum :=high+1 ;
Chart1.LeftAxis.minimum :=low-1 ;
series1.AddCandle(now,open,high,low,close);
chart1.Axes.Bottom.AdjustMaxMin;
self.series1.CalcFirstLastVisibleIndex;
self.Series2.CalcFirstLastVisibleIndex;
first1:=series1.FirstDisplayedIndex;
last1:=series1.LastDisplayedIndex;
first2:=series2.FirstDisplayedIndex;
last2:=series2.LastDisplayedIndex;
//first2:=chart1.Series[1].FirstDisplayedIndex;
//last2:=chart1.Series[1].LastDisplayedIndex;
codesite.Send(format('first1:%d first2:%d last1:%d last2:%d',[first1,first2,last1,last2]));