To that end I translated the existing Metatrader interface to a simple drop-in VB6 class that may be accessed in Visual Studio, or from VBA from Excel. This handy interface in conjunction with 7Bit's dll allows a VB6 / VBA developer to access the power of the R project directly from code.
I've been using this for some time but decided it was time to share with everyone else. So I put together a simple demo application that shows how to access mt4R.dll in a simple VB6 form application.
You can download Calling R From VB6 VBA. (Please follow the instructions on that page) for use in your own projects.
A note for VB6 / VBA developers:
The array structure of R and VB is not the same. Whereas in R the arrays are arranged as:
A[row, column]
In VB6 / VBA the arrays are declared as follows
Dim A(column, row) as double
When transferring this matrix via Rm (the matrix operation) it will send the data in the correct format if the array in VB is declared as above.
Please let me know if you have any comments, questions or problems getting this code to work.
No comments:
Post a Comment