Changing candle series open tick color

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
pssdelphi
Newbie
Newbie
Posts: 29
Joined: Thu Oct 21, 2004 4:00 am

Changing candle series open tick color

Post by pssdelphi » Fri Mar 13, 2009 4:33 pm

Is there a way that I could just change the open tick color on an entire candle series and leave the high, low, close color unchanged? I am using version 7.07

Thanks,
David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Mar 13, 2009 4:51 pm

Hi David,

I'm afraid this is not possible for now. The only solution I can think of is overwritting your current series with a second series with different colors and high and close values being the same, for example.

However, I'm not sure about what would you like to get exactly. Would you like to paint the line going from the open value to high or low value in a different color? If not, please send us an image of what you'd expect. We will add your request to the wish-list to be considered for inclusion in future releases.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

pssdelphi
Newbie
Newbie
Posts: 29
Joined: Thu Oct 21, 2004 4:00 am

Post by pssdelphi » Fri Mar 13, 2009 5:50 pm

Yes, I am only interested in changing the opening tick color which is the small horizontal line to the left of the vertical high / low line on a OHLC bar. Even better would be the ability to change the open tick color on each individual bar, not just globally for the entire series.

Thanks,
David

pssdelphi
Newbie
Newbie
Posts: 29
Joined: Thu Oct 21, 2004 4:00 am

Post by pssdelphi » Fri Mar 13, 2009 6:09 pm

also, if you do end up adding it to a future release, other might also find it useful to be able to change the color of the close tick as well.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Mar 16, 2009 9:24 am

Hi David,

In the meanwhile, you always could draw lines directly to the canvas to achieve this. This could be a simple example you could extend:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues(25);
  Series1.CandleStyle := csCandleBar;
end;

procedure TForm1.Series1AfterDrawValues(Sender: TObject);
var i, XPos, YPos: Integer;
begin
  for i:=0 to Series1.Count-1 do
  begin
    XPos := Series1.CalcXPos(i);
    YPos := Chart1.Axes.Left.CalcPosValue(Series1.OpenValues.Items[i]);

    with Chart1.Canvas do
    begin
      Pen.Color := clRed;
      Line(XPos, YPos, XPos-(Series1.CandleWidth div 2)-1, YPos);
    end;
  end;
end;
Note that I supposed that you are working with CandleStyle as csCandleBar.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

pssdelphi
Newbie
Newbie
Posts: 29
Joined: Thu Oct 21, 2004 4:00 am

Post by pssdelphi » Mon Mar 16, 2009 1:24 pm

Thanks for the thinking. Although I am working with OHLC bars and decided on a more direct approach, I modified the source code with a few AssignVisiblePenColor calls in the right places and it works a treat.

Post Reply