Question on Darvas Charts - High/Low Box Data

TeeChart for ActiveX, COM and ASP
Post Reply
TomB
Newbie
Newbie
Posts: 3
Joined: Fri Feb 17, 2006 12:00 am

Question on Darvas Charts - High/Low Box Data

Post by TomB » Sun Nov 18, 2007 4:07 pm

I am trying to retrieve some data from the created Darvas Chart. Specifically I would like to retrieve both the High & Low box values for the most recent/current "darvas box" on the chart - I am using VFP, but VB code would be fine too. I see where you can retrieve the number of boxes created, but I want to be able to get the High & Low values of the last box created.

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

Post by Yeray » Mon Nov 19, 2007 9:33 am

Hi TomB,

You could use some code lika following:

Code: Select all

TChart1.Series(0).asDarvas.HighValues.Value(TChart1.Series(0).Count - 1)
TChart1.Series(0).asDarvas.LowValues.Value(TChart1.Series(0).Count - 1)
Note that you may need to call the following function in order to update the series values and include the last point added to the calculation:

Code: Select all

TChart1.Environment.InternalRepaint
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

TomB
Newbie
Newbie
Posts: 3
Joined: Fri Feb 17, 2006 12:00 am

Post by TomB » Thu Dec 06, 2007 2:25 am

I see where you can get the individual candle High/Low/Close with your suggestion, but what I am trying to get is the Shaded Darvas Box itself's High/Low Values - the candlesticks are contained with the Darvas Box.

I see where you can get the number of Darvas Boxes with:
TChart1.Series(0).asDarvas.NumBoxes but I do not readily see where to get the High/Low values of the current Darvas Box or any selected Darvas Box on the Chart (I would like to be able to retrieve High/Low of any selected Darvas Box).

Thanks in advance for the help

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 Dec 07, 2007 10:50 am

Hi TomB,

Yes, this is possible. You can do something like this:

Code: Select all

Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    Dim BoxIndex As Integer
    
    With TChart1.Series(1).asDarvas
        BoxIndex = .ClickedBox(X, Y)
        
        TChart1.Header.Text.Clear
        TChart1.Header.Text.Add ("High: " & CStr(TChart1.Axis.Left.CalcPosPoint(.BoxesRect(BoxIndex).Top)))
        TChart1.Header.Text.Add ("Low: " & CStr(TChart1.Axis.Left.CalcPosPoint(.BoxesRect(BoxIndex).Bottom)))
    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