Mapping a candle series date to a horizontal axis percentage

TeeChart for ActiveX, COM and ASP
Post Reply
Willy
Newbie
Newbie
Posts: 2
Joined: Wed Oct 13, 2004 4:00 am
Location: Chicago, IL

Mapping a candle series date to a horizontal axis percentage

Post by Willy » Tue Oct 19, 2004 5:49 pm

I'm using a candle series. Given a valid date for one of the candles, how do I get a percentage of where it is on the horizontal axis to pass to the ColorBand tool? What I am really trying to do is put vertical bands on the candle chart to show when in market positions.
Thanks in advance.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Oct 20, 2004 8:31 am

Hi Willy,
I'm using a candle series. Given a valid date for one of the candles, how do I get a percentage of where it is on the horizontal axis to pass to the ColorBand tool? What I am really trying to do is put vertical bands on the candle chart to show when in market positions.
You could try something like the following:

Code: Select all

Private Sub Command1_Click()
With TChart1
    .Tools.Add tcColorband
    .Tools.Items(0).asColorband.Axis = .Axis.Bottom
    .Tools.Items(0).asColorband.StartValue = DateValue("20/10/2004")
    .Tools.Items(0).asColorband.EndValue = DateValue("25/10/2004")
    
End With
End Sub

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scCandle
    .Series(0).FillSampleValues 20
End With
End Sub
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Willy
Newbie
Newbie
Posts: 2
Joined: Wed Oct 13, 2004 4:00 am
Location: Chicago, IL

Post by Willy » Wed Oct 20, 2004 11:33 am

Thanks for the useful information and the timely response. I've been overwhelmed by all the interfaces and objects in TeeChart and blew right past the simple solution to try vastly more complicated ones that didn't work.

Post Reply