Page 1 of 1

Question on Darvas Charts - High/Low Box Data

Posted: Sun Nov 18, 2007 4:07 pm
by 9530361
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.

Posted: Mon Nov 19, 2007 9:33 am
by yeray
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

Posted: Thu Dec 06, 2007 2:25 am
by 9530361
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

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