Recent

Author Topic: TACHart - openhighlowclose / Candles - 2 series allowed?  (Read 1533 times)

Nicole

  • Hero Member
  • *****
  • Posts: 970
TACHart - openhighlowclose / Candles - 2 series allowed?
« on: March 18, 2023, 11:00:14 am »
There is a TAChart with 2 OHLCseries.
My problem: Both series are shown - but never at the same time.
If I put commentary brackets around one adding, - the other one is shown.

Any ideas how to display both series at the same time?

   
Code: Pascal  [Select][+][-]
  1. Chart_Kontrakte.Title.Text.Text:='';
  2.    SeriesKontrakt_1.Clear;
  3.    SeriesKontrakt_2.Clear;
  4.     IBQuery_Kontrakt_1.SQL.Text:='Select first :Baranzahl skip :Laenge ID_KURSZEILEN, FK_JDATUM, FK_KONTRAKT, '+
  5.        'O, H, L, C, volume, openinterest From TBKURSZEILEN where FK_KONTRAKT = :fk '+
  6.        ' order by FK_JDATUM asc';
  7.     IBQuery_Kontrakt_1.ParamByName('Baranzahl').AsInteger:=Baranzahl; // das ist hier die abgeschnittene Baranzahl
  8.     IBQuery_Kontrakt_1.ParamByName('Laenge').AsInteger:=Laenge;
  9.     IBQuery_Kontrakt_1.ParamByName('fk').AsInteger:=id1;
  10.     IBQuery_Kontrakt_1.Active:=true;
  11.                            {  }
  12.     while not IBQuery_Kontrakt_1.EOF do begin  // zeichnet das Chart als Candles
  13.          SeriesKontrakt_1.AddXOHLC(
  14.            IBQuery_Kontrakt_1.FieldByName('FK_JDATUM').AsDateTime,
  15.            IBQuery_Kontrakt_1.FieldByName('O').AsFloat,
  16.            IBQuery_Kontrakt_1.FieldByName('H').AsFloat,
  17.            IBQuery_Kontrakt_1.FieldByName('L').AsFloat,
  18.            IBQuery_Kontrakt_1.FieldByName('C').AsFloat
  19.            );
  20.         IBQuery_Kontrakt_1.Next;
  21.                                       end;
  22.  
  23.  
  24.     IBQuery_Kontrakt_2.SQL.Text:='Select first :Baranzahl skip :Laenge ID_KURSZEILEN, FK_JDATUM, FK_KONTRAKT, '+
  25.        'O, H, L, C, volume, openinterest From TBKURSZEILEN where FK_KONTRAKT = :fk '+
  26.        ' order by FK_JDATUM asc';
  27.     IBQuery_Kontrakt_2.ParamByName('Baranzahl').AsInteger:=Baranzahl; // das ist hier die abgeschnittene Baranzahl
  28.     IBQuery_Kontrakt_2.ParamByName('Laenge').AsInteger:=Laenge;
  29.     IBQuery_Kontrakt_2.ParamByName('fk').AsInteger:=id1;
  30.     IBQuery_Kontrakt_2.Active:=true;
  31.  
  32.     while not IBQuery_Kontrakt_2.EOF do begin  // zeichnet das Chart als Candles
  33.          SeriesKontrakt_2.AddXOHLC(
  34.            IBQuery_Kontrakt_2.FieldByName('FK_JDATUM').AsDateTime,
  35.            IBQuery_Kontrakt_2.FieldByName('O').AsFloat,
  36.            IBQuery_Kontrakt_2.FieldByName('H').AsFloat,
  37.            IBQuery_Kontrakt_2.FieldByName('L').AsFloat,
  38.            IBQuery_Kontrakt_2.FieldByName('C').AsFloat
  39.            );
  40.         IBQuery_Kontrakt_2.Next;
  41.                                       end;

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: TACHart - openhighlowclose / Candles - 2 series allowed?
« Reply #1 on: March 18, 2023, 12:03:02 pm »
I don't see any difference between both queries, neither in the fields and tablename nor in the parameter values.

The attached project demonstrates that it is no problem to overlay two OHLC series in the same chart.
« Last Edit: March 18, 2023, 12:06:39 pm by wp »

Nicole

  • Hero Member
  • *****
  • Posts: 970
[solved] Re: TACHart - openhighlowclose / Candles - 2 series allowed?
« Reply #2 on: March 18, 2023, 04:42:06 pm »
Thank you for the project!
I recommend download for using random values and using ohlc value in the shortest way.
I kept it for my example library.

My problem is solved. 
How?
How to put it: The stupid component drew what I had asked for, - instead of what I thought of.  :-[

 

TinyPortal © 2005-2018