I am trying to capture the results of Financial Formulas in my VB.Net 2012 program.
I have just learned (self taught) VB.net using Visual studio 2012 Express. Almost all of the examples I have found are older C# which do not convert into 2012. I am having trouble manually translating especially when so much is hidden in the chart parameters. I would like VB.Net info is possible.
I am using a Downloaded CSV file with 255 rows of Stock quote data; Formated like this
Date,Open,High,Low,Close,Volume,Adj Close
2012-06-15,8.73,8.82,8.65,8.82,16952400,8.82
I would like to calculate the value each day using several chart formulas and compare the results to the Adj Close for that day to determine if I should look at the stock further.
so here are the questions:
1. How can I get access to the results of the MSChart formulas so I can process them within my program.
2. Are there examples or hints somewhere that shows how to take my 250 rows of CSV data and process through formulas. All the examples I have found only have a couple of rows fo program generated data. When I try to adapt to my file i get a message "Invalid Period specified for the ACCUMULATEDDISTRIBUTION formula.Increase the number of data points, or decrease the Period" , I do not know how to do either.
this is what I have tryed so far adapter from C# examples:
If File.Exists(TempDir + "\" + TempFile) = False Then
strMessage = "File does not exist"
MessageBox.Show(strMessage)
End If
' Create a connection string.
Dim ConStr As String = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & TempDir & ";" & "Extended Properties=""Text;HDR=no;FMT=Delimited;""")
Dim myConnection As New OleDbConnection(ConStr)
' Create a database command on the connection using query
Dim mySelectQuery As String = "Select * from " + TempFile
Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)
Try
' Open the connection and create the reader
myCommand.Connection.Open()
Dim myReader As OleDbDataReader = myCommand.ExecuteReader '(CommandBehavior.CloseConnection)
Chart1.DataManipulator.FinancialFormula(FinancialFormula.AccumulationDistribution, "Input:Y,Input:Y2,Input:Y4,Volume", "Indicators")
' Close connection and data reader
myReader.Close()
myConnection.Close()
Catch ex As Exception
strMessage = ex.Message
MessageBox.Show(strMessage)
End Try