Page 1 of 1

How tchart ocx calculate P&f with close price using visu

Posted: Sun May 10, 2009 7:10 pm
by 15053038
am currently building an application, which uses Point and Figure Charts.

I would like to know is more about how TChart calculates Point and Figure Charts.

We would like to provide three charts in a variety of ways based on:
-Closing Price.
-High or low price for upward movements and downward movements respectively.
-Typical price (calculated as: (High + Low + Close) / 3.)

I would like more information on how TChart calculates the point and figure chart and what it is based on using Visual Basic 6 code

the next code i can't controlled To how to cacualte
Private Sub chk_box()

Set rs2 = New ADODB.Recordset
rs2.CursorType = adOpenKeyset
rs2.LockType = adLockOptimistic
rs2.Source = "ind8"
rs2.ActiveConnection = db
rs2.Open
rs2.MoveFirst
f = rs2!cp

Select Case f
Case 0.1 To 5
r = 0.25
Case 5.1 To 20
r = 0.5
Case 20.1 To 100
r = 1
Case 100.1 To 200
r = 3
Case 200 To 1000
r = 5
End Select
End Sub
Private Sub dr_chart()
Me.Label1.Caption = r
Dim rs As New ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Source = "ind8"
rs.ActiveConnection = db
rs.Open "select * from ind8" ' where comp_code='" & Me.txt2 & "'" & "and ema1<>0 " & " order by stock_date"
' Retrieve records....

TChart1.Series(0).DataSource = rs
TChart1.Series(0).asPointFigure.OpenValues.ValueSource = rs.Fields(4).Name
TChart1.Series(0).asPointFigure.CloseValues.ValueSource = rs.Fields(7).Name ' close
TChart1.Series(0).asPointFigure.HighValues.ValueSource = rs.Fields(5).Name
TChart1.Series(0).asPointFigure.LowValues.ValueSource = rs.Fields(6).Name
' TChart2.Series(0).asPointFigure.DateValues.ValueSource = rs.Fields(3).Name
TChart1.Series(0).asPointFigure.BoxSize = r
TChart1.Series(0).asPointFigure.ReversalAmount = 3
End Sub

Now i want to know How To Calculate Or Draw X Or O
using Close Price
Can U Provide me sample Code
Thank 4 ever

Posted: Mon May 11, 2009 2:04 pm
by yeray
Hi,

Here there is an explanation of what is the PointFigure series.
Here there is the same question answered time ago.
And here you have a VB6 example:

Code: Select all

Private Sub Form_Load()
  TChart1.AddSeries scPointFigure
  
  ' declare a Connection and RecordSet variables...
  Dim Data As New ADODB.Connection
  Dim Record As New ADODB.Recordset

  Data.Open "TeeChart Pro Database", "", ""
  Record.Open "orders", Data, adOpenKeyset

  'The Recordset variable can now be set
  'directly to the DataSource
  TChart1.Series(0).DataSource = Record

  'The syntax for LabelsSource and YValues.ValueSource properties is:

  With TChart1.Series(0).asPointFigure
    .DateValues.ValueSource = "SHIPDATE"
    .HighValues.ValueSource = "ORDERNO"
    .OpenValues.ValueSource = "ORDERNO"
    .LowValues.ValueSource = "CUSTNO"
    .CloseValues.ValueSource = "CUSTNO"
  End With
End Sub