Intraday Candle Charts

TeeChart for ActiveX, COM and ASP
Post Reply
JuanLu
Newbie
Newbie
Posts: 5
Joined: Fri Nov 23, 2007 12:00 am

Intraday Candle Charts

Post by JuanLu » Tue Jul 14, 2009 11:36 am

Hi! This is my first post, and I want to thank for your great soft.

How could be to discard in an intraday graph (bottom axis interval with one minute) the frame time where there is no data?
Market opens 08:00 to 22:00, from 22:00 to 08:00 is closed. If I load two consecutive days, the frame time closed appears in the chart with no data.(I want to implement with other intervals, from minutes to hours.)

Thanks in advance.

JuanLu

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

Re: Intraday Candle Charts

Post by Yeray » Tue Jul 14, 2009 3:40 pm

Hi JuanLu,

The axis don't allow gaps so to achieve that we have to think in another solution.

For example you could use different series for the different days. Doing this way, you will be able to use an horizontal axis for each series (day) and then you could show all them one after the other. Here is an example in vb6:

Code: Select all

Private Sub Form_Load()
  TeeCommander1.Chart = TChart1

  TChart1.AddSeries scFastLine
  TChart1.AddSeries scFastLine
  
  TChart1.Aspect.View3D = False
  TChart1.Legend.Visible = False
  
  Dim Values(0 To 1679) As Double
  Values(0) = Rnd * 1000 + 1000
  Dim i As Integer
  For i = 1 To 1679
    Values(i) = Values(i - 1) + Rnd * 10 - 5
  Next i
  
  Dim StartTime As Date
  StartTime = DateAdd("h", 8, DateValue("01/01/2009"))
  For i = 0 To 839
    TChart1.Series(0).AddXY DateAdd("n", i, StartTime), Values(i), "", clTeeColor
  Next i
  
  StartTime = DateAdd("h", 8, DateValue("01/02/2009"))
  For i = 0 To 839
    TChart1.Series(1).AddXY DateAdd("n", i, StartTime), Values(i + 840), "", clTeeColor
  Next i
  
  TChart1.Series(1).HorizontalAxisCustom = TChart1.Axis.AddCustom(True)
  TChart1.Axis.Bottom.EndPosition = 50
  TChart1.Axis.Custom(0).StartPosition = 50
  
  TChart1.Tools.Add tcColorLine
  TChart1.Tools.Items(0).asColorLine.Axis = TChart1.Axis.Bottom
  TChart1.Tools.Items(0).asColorLine.Style = clMaximum
  
  TChart1.Series(0).XValues.DateTime = True
  TChart1.Series(1).XValues.DateTime = True
End Sub
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

Post Reply