Jump to content
Software FX Community

How do I read a field to plot on a chart?


User (Legacy)

Recommended Posts

I'm trying to read data from a file that looks like this: 

"Date","Open","High","Low","Close"

8/03/1999, 62.50000, 62.56250, 60.25000, 61.12500

8/04/1999, 61.43750, 62.68750, 60.31250, 60.50000

8/05/1999, 61.12500, 61.56250, 58.37500, 61.50000

8/06/1999, 61.50000, 63.25000, 61.00000, 62.25000

8/07/1999, 62.31250, 63.56250, 60.31250, 61.03125

8/08/1999, 62.31250, 63.56250, 60.31250, 61.03125

8/09/1999, 63.12500, 63.87500, 59.62500, 59.81250

And then use the following code to display it in a OHLC chart. What do I use

as variables in place of "Open value!", and etc.?

Dim CfxFile As New CfxDataFile

Dim nPoints As Integer

Dim j As Integer

CfxFile.FileName = App.Path & "\csco.csv" ' data file

ChartFX1.GetExternalData CfxFile

nPoints = 7

ChartFX1.Gallery = OPENHILOWCLOSE

ChartFX1.OpenDataEx COD_VALUES, 4, nPoints ' Code to set the data

For j = 0 To nPoints - 1

ChartFX1.ValueEx(OHLC_LOW, j) = Open value!

ChartFX1.ValueEx(OHLC_OPEN, j) = Hi value!

ChartFX1.ValueEx(OHLC_CLOSE, j) = Low value!

ChartFX1.ValueEx(OHLC_HIGH, j) = Close value!

Next j

' Close the VALUES channel

ChartFX1.CloseData COD_VALUES

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...