Multi-line series.

TeeChart for ActiveX, COM and ASP
Post Reply
Lars67
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Multi-line series.

Post by Lars67 » Sat Dec 30, 2006 1:06 pm

I'm not familiar with TeeChart (ActiveX) and I have to do following: In trading application I have to add some indicators which have two or more lines as a result (similar to Bollinger Bands). Moreover some of these indicators must have their own axis (not shared with main price series) and sometimes these lines must have different colors. Problem is that whatever I tried I couldn't make this work and I couldn't find an example how to do this. Can anyone help me with some hints how this can be made.

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

Post by Narcís » Tue Jan 02, 2007 9:03 am

Hi Lars67,

To have the lines set to different axes you should read Tutorial 4 - Axis Control. Also could help reading Tutorial 6 - Working with Series.

Also, example of this can be found at the features demo, specially at All Features\Welcome!\Axes.

You'll find the tutorials and features demo at TeeChart's program group.
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

Lars67
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Post by Lars67 » Tue Jan 02, 2007 12:25 pm

Setting lines to different axes is not a problem. Main problem is adding multi line series as I wrote in previous post (similar to Bollinger bands which have two lines for one indicator).

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

Post by Narcís » Wed Jan 03, 2007 9:42 am

Hi Lars67,

Ok, then you need to create additional series for each band, for example:

Code: Select all

Private Sub Form_Load()
    Dim Index As Integer
    
    InitSeries (Index)
    
    For i = 0 To 10
        AddSeriesValue Index, Now + i, Rnd, Rnd, Rnd, Rnd
    Next
End Sub

Private Sub InitSeries(ByRef CandleIndex As Integer)
    CandleIndex = TChart1.AddSeries(scCandle)
    TChart1.AddSeries scLine
    TChart1.AddSeries scLine
End Sub

Private Sub AddSeriesValue(ByVal Series As Integer, ByVal D As Double, ByVal O As Double, _
                            ByVal H As Double, ByVal L As Double, ByVal C As Double)
    With TChart1
        .Series(Series).asCandle.AddCandle D, O, H, L, C
        .Series(Series + 1).AddXY D, H + 5, "", clTeeColor
        .Series(Series + 2).AddXY D, L - 5, "", clTeeColor
    End With
End Sub
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

Post Reply